finish fields docs intial ver,add test for related name, fix child_name(s) in reverse relations

This commit is contained in:
collerek
2020-08-13 12:54:42 +02:00
parent 24eb0b30e7
commit 8c7051b07e
11 changed files with 572 additions and 41 deletions

View File

@ -35,12 +35,12 @@ class BaseField:
@property
def is_required(self) -> bool:
return (
not self.nullable and not self.has_default and not self.is_auto_primary_key
not self.nullable and not self.has_default and not self.is_auto_primary_key
)
@property
def default_value(self) -> Any:
default = self.default if self.default is not None else self.server_default
default = self.default
return default() if callable(default) else default
@property