Add About and AboutItem models

This commit is contained in:
M.Ravi 2017-10-18 16:53:32 +02:00
parent 5e2d1966f8
commit 04e72696f1

View file

@ -11,7 +11,7 @@ class UngelichPicture(CMSPlugin):
related_name="image", related_name="image",
on_delete=models.SET_NULL on_delete=models.SET_NULL
) )
title = models.CharField(max_length=200) title = models.CharField(max_length=400)
class UngelichContactUsSection(CMSPlugin): class UngelichContactUsSection(CMSPlugin):
@ -47,3 +47,21 @@ class ServiceItem(CMSPlugin):
def copy_relations(self, oldinstance): def copy_relations(self, oldinstance):
self.glasfaser_service = oldinstance.glasfaser_service self.glasfaser_service = oldinstance.glasfaser_service
class About(Service):
pass
class AboutItem(UngelichPicture):
inverted = models.BooleanField(default=False)
glasfaser_about = models.ForeignKey(About)
def __str__(self):
alignment = "Right" if self.inverted else "Left"
return "{alignment} - {title}".format(
alignment=alignment, title=self.title
)
def copy_relations(self, oldinstance):
self.glasfaser_about = oldinstance.glasfaser_about