Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 def save(self, *args, **kw):
     if not self.slug:
         self.slug = slugify(self.title)
     super(Essay, self).save(*args, **kw)
     self.clear_cache()
Пример #4
0
 def save(self, *args, **kw):
     self.slug = slugify(self.name)
     if self.order is None:
         self.order = self.id
     models.Model.save(self)
Пример #5
0
 def save(self, *args, **kw):
     if not self.slug:
         self.slug = slugify(self.title)
     super(Essay, self).save(*args, **kw)
     self.clear_cache()
Пример #6
0
 def save(self,*args,**kw):
     self.slug = slugify(self.name)
     if self.order is None:
         self.order = self.id
     models.Model.save(self)