diff options
author | Alexander Sosnovskiy <alecs.box@gmail.com> | 2015-07-02 11:43:15 +0300 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-12-25 20:01:31 -0500 |
commit | 2a7ce34600d0f879e93c9a5e02215948ed3bb6ac (patch) | |
tree | d1a4770772b452513e1d64c090dc15ae287afe70 /tests/many_to_many | |
parent | a1d0c60fa05cbad2e5a25ec37e0afaf1b84c9302 (diff) | |
download | django-2a7ce34600d0f879e93c9a5e02215948ed3bb6ac.tar.gz |
Fixed #14286 -- Added models.BigAutoField.
Diffstat (limited to 'tests/many_to_many')
-rw-r--r-- | tests/many_to_many/models.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/many_to_many/models.py b/tests/many_to_many/models.py index 5688c853d6..3e4cdd2e70 100644 --- a/tests/many_to_many/models.py +++ b/tests/many_to_many/models.py @@ -24,11 +24,21 @@ class Publication(models.Model): @python_2_unicode_compatible +class Tag(models.Model): + id = models.BigAutoField(primary_key=True) + name = models.CharField(max_length=50) + + def __str__(self): + return self.name + + +@python_2_unicode_compatible class Article(models.Model): headline = models.CharField(max_length=100) # Assign a unicode string as name to make sure the intermediary model is # correctly created. Refs #20207 publications = models.ManyToManyField(Publication, name='publications') + tags = models.ManyToManyField(Tag, related_name='tags') def __str__(self): return self.headline |