allow customization of through model relation names

This commit is contained in:
collerek
2021-04-16 16:27:07 +02:00
parent 1c24ade8c8
commit 15e12ef55b
7 changed files with 223 additions and 13 deletions

View File

@ -53,6 +53,12 @@ class BaseField(FieldInfo):
"is_relation", None
) # ForeignKeyField + subclasses
self.is_through: bool = kwargs.pop("is_through", False) # ThroughFields
self.through_relation_name = kwargs.pop("through_relation_name", None)
self.through_reverse_relation_name = kwargs.pop(
"through_reverse_relation_name", None
)
self.skip_reverse: bool = kwargs.pop("skip_reverse", False)
self.skip_field: bool = kwargs.pop("skip_field", False)