1. Thomas Weholt
  2. dse4

Commits

weholt  committed 62ca8e0 Draft

Code clean up.

  • Participants
  • Parent commits 37be873
  • Branches default

Comments (0)

Files changed (1)

File dse/__init__.py

View file
  • Ignore whitespace
         field_defs = model._meta._fields()
     for f in field_defs:
         if field == f.name:            
-            if isinstance(f.default, object):
-                if isinstance(f.default, bool) or isinstance(f.default, int) or isinstance(f.default, str):
-                    return f.default
-                elif f.default.__name__ == 'NOT_PROVIDED':
+            if hasattr(f.default, '__name__'):
+                if f.default.__name__ == 'NOT_PROVIDED':
                     return None
             return f.default
     return None