1. Matthew Schinckel
  2. django-timedelta-field

Commits

Matthew Schinckel  committed 2720487

Add support for django 1.7

Run django.setup(), if present.

Stub for Field.deconstruct()

References #15.

  • Participants
  • Parent commits a5117fd
  • Branches default

Comments (0)

Files changed (2)

File tests.py

View file
         test_runner = get_runner(global_settings)
 
     test_runner = test_runner()
+    
+    if getattr(django, 'setup', None):
+        django.setup()
+    
     failures = test_runner.run_tests(['timedelta'])
     
     sys.exit(failures)

File timedelta/fields.py

View file
     def db_type(self, connection):
         return COLUMN_TYPES[connection.settings_dict['ENGINE']]
 
-
+    def deconstruct(self):
+        return (
+            self.name, 'timedelta.fields.TimedeltaField',
+            (), {
+                'min_value': self.min_value, 
+                'max_value': self.max_value
+            }
+        )