When I'm using Joined Table Inheritance by specifying __mapper_args__ in my model, I get the following error calling model_form() on my model:
AttributeError: Neither 'Label' object nor 'Comparator' object has an attribute 'nullable'
I can get around this by making the following change to model_fields():
field_args = field_args or {}
properties = []
for prop in mapper.attrs.values():
+ if getattr(prop, "_is_polymorphic_discriminator", False):
+ continue
if getattr(prop, "columns", None):
if exclude_fk and prop.columns[0].foreign_keys:
continue
I don't have deep enough knowledge of sqlalchemy to know if there is a better field I should be checking. If this looks right, I'm happy to open a PR.
When I'm using Joined Table Inheritance by specifying
__mapper_args__in my model, I get the following error callingmodel_form()on my model:I can get around this by making the following change to
model_fields():field_args = field_args or {} properties = [] for prop in mapper.attrs.values(): + if getattr(prop, "_is_polymorphic_discriminator", False): + continue if getattr(prop, "columns", None): if exclude_fk and prop.columns[0].foreign_keys: continueI don't have deep enough knowledge of sqlalchemy to know if there is a better field I should be checking. If this looks right, I'm happy to open a PR.