def save(self, *args, **kw): # ensure a user exists but make sure after the contact exists # or our signal will create a ContactDetail for the user if self.user is None: self.user = User.objects.create(username=self.organization) self.id = ContactDetail.objects.filter(user=self.user)[0].id if not self.name: self.name = self.organization if not self.slug: self.slug = slugify(self.organization) models.Model.save(self)
def save(self,*args,**kw): # ensure a user exists but make sure after the contact exists # or our signal will create a ContactDetail for the user if self.user is None: self.user = User.objects.create(username=self.organization) self.id = ContactDetail.objects.filter(user=self.user)[0].id if not self.name: self.name = self.organization if not self.slug: self.slug = slugify(self.organization) models.Model.save(self)
def save(self, *args, **kw): if not self.slug: self.slug = slugify(self.title) super(Essay, self).save(*args, **kw) self.clear_cache()
def save(self, *args, **kw): self.slug = slugify(self.name) if self.order is None: self.order = self.id models.Model.save(self)
def save(self,*args,**kw): self.slug = slugify(self.name) if self.order is None: self.order = self.id models.Model.save(self)