mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Enforced uniqueness of natural keys used in tests.
This commit is contained in:
parent
678f958ef9
commit
cf21fc9bf0
4 changed files with 13 additions and 13 deletions
|
@ -24,7 +24,7 @@ class FKDataNaturalKey(models.Model):
|
|||
|
||||
|
||||
class NaturalKeyThing(models.Model):
|
||||
key = models.CharField(max_length=100)
|
||||
key = models.CharField(max_length=100, unique=True)
|
||||
other_thing = models.ForeignKey('NaturalKeyThing', on_delete=models.CASCADE, null=True)
|
||||
other_things = models.ManyToManyField('NaturalKeyThing', related_name='thing_m2m_set')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue