X-Git-Url: https://git.sommitrealweird.co.uk/sommitrealweird.git/blobdiff_plain/acedb5e82f30e6502e2801db9f8d64d879f44347..64484656099dfff360742f3a2c1e4d07bc1f6bd8:/sommitrealweird/bpcms/models.py diff --git a/sommitrealweird/bpcms/models.py b/sommitrealweird/bpcms/models.py index ca3eb06..0cb821b 100644 --- a/sommitrealweird/bpcms/models.py +++ b/sommitrealweird/bpcms/models.py @@ -29,11 +29,14 @@ class Document(models.Model): slug = models.SlugField() content = models.TextField() + class Meta: + ordering = ["folder"] + def __str__(self): return self.__unicode__() def __unicode__(self): - return u'%s (%s)' %(self.title, self.slug) + return u'%s - %s' %(self.get_basic_url(), self.title) def save(self): super(Document, self).save() @@ -89,11 +92,11 @@ class Folder(models.Model): while curfolder != None: folders.append(curfolder.slug) curfolder = curfolder.parent - + folders.reverse() folderstring = "/".join(folders) return folderstring - + def save(self, force_insert=False, force_update=False): super(Folder, self).save(force_insert, force_update) if self.parent == None: