예제 #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()
예제 #2
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()
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)