Ticket #17310: kill_test.2.patch
File kill_test.2.patch, 1.0 KB (added by , 13 years ago) |
---|
-
models.py
old new 5 5 6 6 class Award(models.Model): 7 7 name = models.CharField(max_length=25) 8 object_id = models.PositiveIntegerField()9 content_type = models.ForeignKey(ContentType)10 content_object = generic.GenericForeignKey( )8 app_object_id = models.PositiveIntegerField() 9 app_content_type = models.ForeignKey(ContentType) 10 content_object = generic.GenericForeignKey('app_content_type', 'app_object_id') 11 11 12 12 class AwardNote(models.Model): 13 13 award = models.ForeignKey(Award) … … 15 15 16 16 class Person(models.Model): 17 17 name = models.CharField(max_length=25) 18 awards = generic.GenericRelation(Award) 18 awards = generic.GenericRelation(Award, 19 content_type_field= 'app_content_type', 20 object_id_field='app_object_id') 19 21 20 22 class Book(models.Model): 21 23 pagecount = models.IntegerField()