def save(self, *args, **kwargs): super(OrganisationName, self).save(*args, **kwargs) org = self.organisation if self.main == True: # If we are main check that no other names for this org are for name in org.names.filter(main=True).exclude(id=self.id): name.main = False name.save() # create the orgs slug based on our name org.slug = slughifi(self.name) org.save() else: # if there are no mained names set main on ourselves if org.names.filter(main=True).count() == 0: self.main = True self.save()
def save (self, *args, **kwargs): max_len = self._meta.get_field('slug').max_length self.slug = slughifi(str(self)[:max_len]).strip('#').replace('/','') super(DraftLaw, self).save(*args, **kwargs)
def save (self, *args, **kwargs): max_len = self._meta.get_field('slug').max_length self.slug = slughifi(str(self)[:max_len]) super(IncomeDeclaration, self).save(*args, **kwargs)
def save(self, *args, **kwargs): max_len = self._meta.get_field('slug').max_length self.slug = slughifi(str(self)[:max_len]) super(VotingRecord, self).save(*args, **kwargs)
def save (self, *args, **kwargs): max_len = self._meta.get_field('slug').max_length self.slug = slughifi(str(self)[:max_len]) super(VotingRecord, self).save(*args, **kwargs)
def save(self, *args, **kwargs): max_len = self._meta.get_field("slug").max_length self.slug = slughifi(str(self)[:max_len]) super(DraftLaw, self).save(*args, **kwargs)
def save(self, *args, **kwargs): max_len = self._meta.get_field('slug').max_length self.slug = slughifi(str(self)[:max_len]).strip('#').replace('/', '') super(DraftLaw, self).save(*args, **kwargs)