Skipped UUID-pk model if Django less than 1.8

master
Brandon Taylor 2016-10-12 22:14:22 -04:00
parent bf75b85190
commit 6e6b92d759
1 changed files with 6 additions and 5 deletions

View File

@ -33,6 +33,7 @@ class TestSortableModel(SortableMixin):
return self.title return self.title
if VERSION > (1, 8):
class TestNonAutoFieldModel(SortableMixin): class TestNonAutoFieldModel(SortableMixin):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
order = models.PositiveIntegerField(editable=False, db_index=True) order = models.PositiveIntegerField(editable=False, db_index=True)