Esempio n. 1
0
class Book(VersionView, NameModel, Harmless):
    _clone_related = ['review', 'galleries']

    author = models.ForeignKey(Author)
    galleries = fields.M2MFromVersion('Gallery')

    def __unicode__(self):
        return self.name
Esempio n. 2
0
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
Esempio n. 3
0
class Abstract(BaseVersionedModel, NameModel):
    associates = fields.M2MFromVersion('self', blank=True)

    class Meta:
        abstract = True
Esempio n. 4
0
class AbstractM2MBook(models.Model):
    books = fields.M2MFromVersion('Book', blank=True)
    cartoon = fields.FKToVersion('Cartoon', blank=True, null=True)

    class Meta:
        abstract = True
Esempio n. 5
0
class BookNoRelated(VersionView, NameModel, Harmless):
    author = models.ForeignKey(Author)
    galleries = fields.M2MFromVersion('Gallery')

    def __unicode__(self):
        return self.name