Skip to content

Commit

Permalink
more proper way to check for class attribute existence
Browse files Browse the repository at this point in the history
  • Loading branch information
dzou committed Jan 8, 2014
1 parent 09c76e7 commit c70a01a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sandman/model/utils.py
Expand Up @@ -119,7 +119,7 @@ def register_classes_for_admin(db_session, show_pks=True,
cls.use_admin == True):
column_list = [column.name for column in
cls.__table__.columns.values()]
if cls.__view__ is not None:
if hasattr(cls, '__view__'):
# allow ability for model classes to specify model views
admin_view_class = type('AdminView', (cls.__view__,),
{'form_columns': column_list})
Expand Down

0 comments on commit c70a01a

Please sign in to comment.