class Book(VersionView, NameModel, Harmless): _clone_related = ['review', 'galleries'] author = models.ForeignKey(Author) galleries = fields.M2MFromVersion('Gallery') def __unicode__(self): return self.name
class Post(VersionView): date = models.DateField() title = models.CharField(max_length=255) slug = models.SlugField(max_length=255, editable=False) body = models.TextField() author = models.ForeignKey(Author, on_delete=models.PROTECT) category = models.ForeignKey(Category) tags = fields.M2MFromVersion(Tag, blank=True) # SEO Section keywords = models.TextField(blank=True) description = models.TextField(blank=True) def __unicode__(self): return u"%s" % self.title
class Abstract(BaseVersionedModel, NameModel): associates = fields.M2MFromVersion('self', blank=True) class Meta: abstract = True
class AbstractM2MBook(models.Model): books = fields.M2MFromVersion('Book', blank=True) cartoon = fields.FKToVersion('Cartoon', blank=True, null=True) class Meta: abstract = True
class BookNoRelated(VersionView, NameModel, Harmless): author = models.ForeignKey(Author) galleries = fields.M2MFromVersion('Gallery') def __unicode__(self): return self.name