58 lines
1.5 KiB
Python
Executable File
58 lines
1.5 KiB
Python
Executable File
from django.db import models
|
|
|
|
class FrontImage(models.Model):
|
|
image = models.ImageField(upload_to='upload/frontImages/')
|
|
caption = models.TextField(blank=True)
|
|
link = models.URLField(verify_exists=False, blank=True, null=True, max_length=512)
|
|
is_active = models.BooleanField(default=True)
|
|
order = models.IntegerField(default=1)
|
|
|
|
def __unicode__(self):
|
|
return self.image.url
|
|
|
|
class Meta:
|
|
ordering = ['order']
|
|
|
|
class SliderBox(models.Model):
|
|
title = models.CharField(max_length=64)
|
|
image = models.ImageField(upload_to='upload/sliderImages/')
|
|
boldText = models.CharField(max_length=256, blank=True)
|
|
normalText = models.CharField(max_length=256, blank=True)
|
|
url = models.CharField(max_length=128, blank=True)
|
|
order = models.IntegerField(default=1)
|
|
imageTop = models.IntegerField(default=0)
|
|
is_displayed = models.BooleanField(default=True)
|
|
|
|
def __unicode__(self):
|
|
return self.title
|
|
|
|
class Meta:
|
|
ordering = ['order', 'id']
|
|
|
|
|
|
class MenuHeading(models.Model):
|
|
name = models.CharField(max_length=64)
|
|
order = models.IntegerField(default=1)
|
|
|
|
def __unicode__(self):
|
|
return self.name
|
|
|
|
class Meta:
|
|
ordering = ['order', 'id']
|
|
|
|
|
|
class MenuItem(models.Model):
|
|
name = models.CharField(max_length=64)
|
|
url = models.CharField(max_length=256)
|
|
menu = models.ForeignKey(MenuHeading)
|
|
order = models.IntegerField(default=1)
|
|
|
|
def __unicode__(self):
|
|
return self.name
|
|
|
|
class Meta:
|
|
ordering = ['order', 'id']
|
|
|
|
|
|
# Create your models here.
|