def save(self, **kwargs): self.slug = slugify_name(self.title) self.popular_name_slug = slugify_name(self.popular_name) if self.law: self.full_title = "%s %s" % (self.law.title, self.title) else: self.full_title = self.title super(Bill, self).save(**kwargs) for mk in self.proposers.all(): mk.recalc_bill_statistics()
def save(self, **kwargs): self.slug = slugify_name(self.title) self.popular_name_slug = slugify_name(self.popular_name) if self.law: self.full_title = "%s %s" % (self.law.title, self.title) else: self.full_title = self.title super(Bill,self).save(**kwargs) for mk in self.proposers.all(): mk.recalc_bill_statistics()
def forwards(self, orm): # Adding field 'Bill.slug' db.add_column('laws_bill', 'slug', self.gf('django.db.models.fields.CharField')(default='', max_length=1000), keep_default=False) # Adding field 'Bill.popular_name_slug' db.add_column('laws_bill', 'popular_name_slug', self.gf('django.db.models.fields.CharField')(default='', max_length=1000, blank=True), keep_default=False) if not db.dry_run: for bill in orm.Bill.objects.all(): bill.slug = slugify_name(bill.title) bill.popular_name_slug = slugify_name(bill.popular_name) bill.save() # this will slugify what's needed
def forwards(self, orm): # Adding field 'Bill.slug' db.add_column('laws_bill', 'slug', self.gf('django.db.models.fields.CharField')( default='', max_length=1000), keep_default=False) # Adding field 'Bill.popular_name_slug' db.add_column('laws_bill', 'popular_name_slug', self.gf('django.db.models.fields.CharField')( default='', max_length=1000, blank=True), keep_default=False) if not db.dry_run: for bill in orm.Bill.objects.all(): bill.slug = slugify_name(bill.title) bill.popular_name_slug = slugify_name(bill.popular_name) bill.save() # this will slugify what's needed
def save(self, **kwargs): self.slug = slugify_name(self.title) self.popular_name_slug = slugify_name(self.popular_name) super(Bill, self).save(**kwargs) for mk in self.proposers.all(): mk.recalc_bill_statistics()
def save(self,**kwargs): self.slug = slugify_name(self.title) self.popular_name_slug = slugify_name(self.popular_name) super(Bill,self).save(**kwargs) for mk in self.proposers.all(): mk.recalc_bill_statistics()