mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Add more stringent M2M tests and fix the bug they exposed
This commit is contained in:
parent
5b522cd85a
commit
52edc16086
4 changed files with 32 additions and 17 deletions
|
@ -37,7 +37,7 @@ class BookWithM2M(models.Model):
|
|||
author = models.ForeignKey(Author)
|
||||
title = models.CharField(max_length=100, db_index=True)
|
||||
pub_date = models.DateTimeField()
|
||||
tags = models.ManyToManyField("Tag", related_name="books")
|
||||
tags = models.ManyToManyField("TagM2MTest", related_name="books")
|
||||
|
||||
class Meta:
|
||||
app_cache = new_app_cache
|
||||
|
@ -62,6 +62,14 @@ class Tag(models.Model):
|
|||
app_cache = new_app_cache
|
||||
|
||||
|
||||
class TagM2MTest(models.Model):
|
||||
title = models.CharField(max_length=255)
|
||||
slug = models.SlugField(unique=True)
|
||||
|
||||
class Meta:
|
||||
app_cache = new_app_cache
|
||||
|
||||
|
||||
class TagIndexed(models.Model):
|
||||
title = models.CharField(max_length=255)
|
||||
slug = models.SlugField(unique=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue