added models for galleries and supporters
Signed-off-by: rscnt <rascnt@gmail.com>
This commit is contained in:
parent
f352f487ca
commit
aa62bd16b8
1 changed files with 30 additions and 0 deletions
|
@ -1,4 +1,6 @@
|
|||
from django.db import models
|
||||
from cms.models import CMSPlugin
|
||||
from filer.fields.image import FilerImageField
|
||||
|
||||
|
||||
class Message(models.Model):
|
||||
|
@ -16,3 +18,31 @@ class Message(models.Model):
|
|||
class Supporter(models.Model):
|
||||
name = models.CharField(max_length=200)
|
||||
description = models.TextField()
|
||||
|
||||
def __str__(self):
|
||||
return "%s" % (self.name)
|
||||
|
||||
|
||||
class DGGallery(models.Model):
|
||||
parent = models.ForeignKey('self', blank=True, null=True)
|
||||
name = models.CharField(max_length=30)
|
||||
|
||||
def __str__(self):
|
||||
return "%s" % (self.name)
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('dgGallery_view', args=[self.pk])
|
||||
|
||||
class Meta:
|
||||
verbose_name_plural = 'dgGallery'
|
||||
|
||||
class DGPicture(models.Model):
|
||||
gallery = models.ForeignKey(DGGallery)
|
||||
image = FilerImageField(related_name='dg_gallery')
|
||||
description = models.CharField(max_length=60)
|
||||
|
||||
def __str__(self):
|
||||
return "%s" % (self.image.name)
|
||||
|
||||
class DGGalleryPlugin(CMSPlugin):
|
||||
dgGallery = models.ForeignKey(DGGallery)
|
||||
|
|
Loading…
Reference in a new issue