from django.db import models
from bpcms.content_val import is_unique_name
+from django.conf import settings
FORMAT_CHOICES = (
('rst', 'reStructuredText'),
islive = models.BooleanField()
folder = models.ForeignKey('Folder', null=True, blank=True)
format = models.CharField(maxlength=10, choices=FORMAT_CHOICES)
- slug = models.SlugField(prepopulate_from=("title",), validator_list=[is_unique_name,])
+ slug = models.SlugField(prepopulate_from=("title",))
content = models.TextField()
def __str__(self):
if folderstring != u'':
folderstring = "%s/" %(folderstring,)
- return "%s%s/" %(folderstring, self.slug)
+ return "%s%s%s/" %(settings.BPCMS_ROOT, folderstring, self.slug)
class Admin:
pass
if folderstring != u'':
folderstring = "%s/" %(folderstring,)
- return "%s" %(folderstring)
+ return "%s%s" %(settings.BPCMS_ROOT, folderstring)
class Admin:
pass