def save(self, *args, **kwargs): self.slug = slugicefy(self.title) flatpage = None try: flatpage = FlatPage.objects.get(url=self.url) except: pass if self.parent: self.url = '/'.join([self.parent.url[:-1], self.slug, '']) else: self.url = '/' if flatpage: flatpage.url = self.url flatpage.save() super(Menu, self).save(*args, **kwargs) for child in self.children.all(): child.save()
def save(self, *args, **kwargs): self.slug = slugicefy(self.title) super(Bookmark, self).save(*args, **kwargs)
def save(self, *args, **kwargs): self.slug = slugicefy(self.title) super(Photo, self).save(*args, **kwargs)
def save(self, *args, **kwargs): self.slug = slugicefy(self.title) super(Article, self).save(*args, **kwargs)
def save(self, *args, **kwargs): self.slug = slugicefy(self.name) super(School, self).save(*args, **kwargs)