mirror of
https://github.com/django/django.git
synced 2025-08-02 01:53:15 +00:00
Fixed #29260 -- Skipped an UPDATE when adding a model instance with primary key that has a default.
This commit is contained in:
parent
e9f74f53cc
commit
85458e94e3
3 changed files with 24 additions and 1 deletions
|
@ -3,6 +3,8 @@ Bare-bones model
|
|||
|
||||
This is a basic model with only two non-primary-key fields.
|
||||
"""
|
||||
import uuid
|
||||
|
||||
from django.db import models
|
||||
|
||||
|
||||
|
@ -40,3 +42,7 @@ class SelfRef(models.Model):
|
|||
# This method intentionally doesn't work for all cases - part
|
||||
# of the test for ticket #20278
|
||||
return SelfRef.objects.get(selfref=self).pk
|
||||
|
||||
|
||||
class PrimaryKeyWithDefault(models.Model):
|
||||
uuid = models.UUIDField(primary_key=True, default=uuid.uuid4)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue