1
0
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:
Andrew Godwin
2012-09-07 14:39:22 -04:00
parent a92bae0f06
commit 375178fc19
4 changed files with 119 additions and 16 deletions

View File

@@ -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)