Skip to content

Commit

Permalink
Add identity arg to ModelView
Browse files Browse the repository at this point in the history
Enable creating multiple views on the same model. See aminalaee#681
  • Loading branch information
DurandA authored Jun 11, 2024
1 parent d062cfa commit ab110d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sqladmin/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __new__(mcls, name, bases, attrs: dict, **kwargs: Any):
)

cls.pk_columns = get_primary_keys(model)
cls.identity = slugify_class_name(model.__name__)
cls.identity = kwargs.get("identity", slugify_class_name(model.__name__))
cls.model = model

cls.name = attrs.get("name", prettify_class_name(cls.model.__name__))
Expand Down

0 comments on commit ab110d8

Please sign in to comment.