Anonymous     Python     12 May 2008    
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class TypeofthePage(models.Model):
type_name = models.CharField(max_length=30)
template_name = models.FilePathField(path=settings.MEDIA_ROOT+"/templates", match="(^.*\.html$)|(^.*\.htm$)", recursive=True)
def __unicode__(self):
return self.type_name
class Admin:
pass
class SomePage(models.Model):
page_name = models.CharField(max_length=30)
page_site = models.ForeignKey(Site)
page_type = models.ForeignKey(TypeofthePage)
parent = models.ForeignKey('self',related_name='childs', blank=True, null=True)
image_top_banner = models.FilePathField(path=settings.MEDIA_ROOT+"/images", match="(^.*\.jpg$)|(^.*\.gif$)|(^.*\.png$)", recursive=True,blank=True)
image_left_banner = models.FilePathField(path=settings.MEDIA_ROOT+"/images", match="(^.*\.jpg$)|(^.*\.gif$)|(^.*\.png$)", recursive=True,blank=True)
page_first_menu = models.BooleanField()
image_first_menu = models.FilePathField(path=settings.MEDIA_ROOT+"/images", match="(^.*\.jpg$)|(^.*\.gif$)|(^.*\.png$)", recursive=True,blank=True)
page_second_menu = models.BooleanField()
image_second_menu = models.FilePathField(path=settings.MEDIA_ROOT+"/images", match="(^.*\.jpg$)|(^.*\.gif$)|(^.*\.png$)", recursive=True,blank=True)
page_third_menu = models.BooleanField()
image_third_menu = models.FilePathField(path=settings.MEDIA_ROOT+"/images", match="(^.*\.jpg$)|(^.*\.gif$)|(^.*\.png$)", recursive=True,blank=True)
long_description = models.TextField(blank=True)
def __unicode__(self):
return self.page_name
class Admin:
# javascript for fck editor
js = ( settings.MEDIA_URL+'fckeditor/fckeditor.js',
settings.MEDIA_URL+'js/somepages.js',
)
pass
class Meta:
unique_together = ("page_name", "page_site", "parent")

Яндекс.Метрика