示例#1
0
	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()
示例#2
0
	def save(self, *args, **kwargs):
		self.slug = slugicefy(self.title)
		super(Bookmark, self).save(*args, **kwargs)
示例#3
0
	def save(self, *args, **kwargs):
		self.slug = slugicefy(self.title)
		super(Photo, self).save(*args, **kwargs)
示例#4
0
	def save(self, *args, **kwargs):
		self.slug = slugicefy(self.title)
		super(Article, self).save(*args, **kwargs)
示例#5
0
	def save(self, *args, **kwargs):
		self.slug = slugicefy(self.name)
		super(School, self).save(*args, **kwargs)