X-Git-Url: https://git.sommitrealweird.co.uk/sommitrealweird.git/blobdiff_plain/acedb5e82f30e6502e2801db9f8d64d879f44347..9227f88e18b73794e86cface4f2aab31ed33f0d4:/sommitrealweird/bpcms/models.py?ds=sidebyside 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: