Skip to content

Commit

Permalink
Merge pull request #2398 from cjmayo/mapper_attrs
Browse files Browse the repository at this point in the history
Fix Exception: Cannot find reverse relation for model
  • Loading branch information
samuelhwilliams committed Jul 25, 2024
2 parents 2cfe747 + 5a59a5b commit 6cefac8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flask_admin/contrib/sqla/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def get_form(model, converter,
mapper = model._sa_class_manager.mapper
field_args = field_args or {}

properties = ((p.key, p) for p in mapper.iterate_properties)
properties = ((p.key, p) for p in mapper.attrs)

if only:
def find(name):
Expand Down
2 changes: 1 addition & 1 deletion flask_admin/contrib/sqla/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def _get_model_iterator(self, model=None):
if model is None:
model = self.model

return model._sa_class_manager.mapper.iterate_properties
return model._sa_class_manager.mapper.attrs

def _apply_path_joins(self, query, joins, path, inner_join=True):
"""
Expand Down

0 comments on commit 6cefac8

Please sign in to comment.