mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #470 -- Added support for database defaults on fields.
Special thanks to Hannes Ljungberg for finding multiple implementation gaps. Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for reviews.
This commit is contained in:
committed by
Mariusz Felisiak
parent
599f3e2cda
commit
7414704e88
@@ -49,5 +49,9 @@ class PrimaryKeyWithDefault(models.Model):
|
||||
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4)
|
||||
|
||||
|
||||
class PrimaryKeyWithDbDefault(models.Model):
|
||||
uuid = models.IntegerField(primary_key=True, db_default=1)
|
||||
|
||||
|
||||
class ChildPrimaryKeyWithDefault(PrimaryKeyWithDefault):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user