- if folderstring != u'':
- folderstring = "%s/" %(folderstring,)
-
- return "%s%s" %(settings.BPCMS_ROOT, folderstring)
-
- class Admin:
- pass
+ return folderstring
+
+ def save(self, force_insert=False, force_update=False):
+ super(Folder, self).save(force_insert, force_update)
+ if self.parent == None:
+ cache.delete('bpcms_mainmenu')
+ else:
+ cache.delete('bpcms_submenu_%s' %(self.get_path()))
+
+ def get_absolute_url(self):
+ if self.parent:
+ return reverse('bpcms.views.document_view', kwargs={'folders': self.parent.get_path(), 'slug': self.slug})
+ else:
+ return reverse('bpcms.views.document_view', kwargs={'slug': self.slug})