예제 #1
0
파일: models.py 프로젝트: vasyiok/scarlet
class Book(VersionView, NameModel, Harmless):
    _clone_related = ['review', 'galleries']

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

    def __unicode__(self):
        return self.name
예제 #2
0
파일: models.py 프로젝트: vasyiok/scarlet
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
예제 #3
0
파일: models.py 프로젝트: vasyiok/scarlet
class Abstract(BaseVersionedModel, NameModel):
    associates = fields.M2MFromVersion('self', blank=True)

    class Meta:
        abstract = True
예제 #4
0
파일: models.py 프로젝트: vasyiok/scarlet
class AbstractM2MBook(models.Model):
    books = fields.M2MFromVersion('Book', blank=True)
    cartoon = fields.FKToVersion('Cartoon', blank=True, null=True)

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

    def __unicode__(self):
        return self.name