45 lines
1.1 KiB
Python
45 lines
1.1 KiB
Python
from django.db import models
|
|
|
|
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.
|