2015-05-02 15:00:15 +00:00
|
|
|
from django.db import models
|
2016-02-08 08:42:01 +00:00
|
|
|
from cms.models import CMSPlugin
|
|
|
|
from filer.fields.image import FilerImageField
|
2015-05-02 15:00:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Message(models.Model):
|
|
|
|
name = models.CharField(max_length=200)
|
|
|
|
email = models.EmailField()
|
|
|
|
phone_number = models.CharField(max_length=200)
|
|
|
|
message = models.TextField()
|
|
|
|
|
|
|
|
received_date = models.DateTimeField('date received')
|
2015-05-02 15:12:46 +00:00
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return "%s - %s - %s" % (self.name, self.email, self.received_date)
|
2016-02-03 13:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Supporter(models.Model):
|
|
|
|
name = models.CharField(max_length=200)
|
2016-02-08 10:31:53 +00:00
|
|
|
description = models.TextField(null=True, blank=True)
|
2016-02-08 08:42:01 +00:00
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return "%s" % (self.name)
|
|
|
|
|
2016-02-14 15:47:07 +00:00
|
|
|
def get_absolute_url(self):
|
|
|
|
return reverse('dgSupporters_view', args=[self.pk])
|
|
|
|
|
2016-02-08 08:42:01 +00:00
|
|
|
|
|
|
|
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)
|
2016-02-14 15:47:07 +00:00
|
|
|
|
|
|
|
class DGSupportersPlugin(CMSPlugin):
|
|
|
|
pass
|