X-Git-Url: https://git.sommitrealweird.co.uk/sommitrealweird.git/blobdiff_plain/56b2cdf3569443cf4504fe085de9db0466dcd09f..128ae2956f9081b6d9fc39daa1318e930d06b7fe:/sommitrealweird/bpcms/models.py diff --git a/sommitrealweird/bpcms/models.py b/sommitrealweird/bpcms/models.py index f538421..70d398a 100644 --- a/sommitrealweird/bpcms/models.py +++ b/sommitrealweird/bpcms/models.py @@ -1,5 +1,6 @@ from django.db import models from bpcms.content_val import is_unique_name +from django.conf import settings FORMAT_CHOICES = ( ('rst', 'reStructuredText'), @@ -11,7 +12,7 @@ class Document(models.Model): 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): @@ -44,7 +45,7 @@ class Document(models.Model): 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 @@ -72,7 +73,7 @@ class Folder(models.Model): if folderstring != u'': folderstring = "%s/" %(folderstring,) - return "%s" %(folderstring) + return "%s%s" %(settings.BPCMS_ROOT, folderstring) class Admin: pass