mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Add M2M repointing
This commit is contained in:
@@ -29,6 +29,16 @@ class Book(models.Model):
|
||||
managed = False
|
||||
|
||||
|
||||
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")
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
|
||||
|
||||
class BookWithSlug(models.Model):
|
||||
author = models.ForeignKey(Author)
|
||||
title = models.CharField(max_length=100, db_index=True)
|
||||
|
||||
Reference in New Issue
Block a user