Example #1
0
    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):
        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()
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 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)
Example #6
0
 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)
Example #7
0
 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)
Example #8
0
 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)