Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Non_ONCO(CommonField):
- def clean(self):
- if not self.id:
- slug = slugify(self.libelle)
- if Non_ONCO.objects.filter(slug_libelle=slug).exists():
- raise ValidationError(u"Ce libellé existe déjà")
- def save(self,force_insert=False,force_update=False):
- self.slug_libelle = slugify(self.libelle)
- super(Non_ONCO,self).save(force_insert=False,force_update=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement