def save(self, *args, **kwargs): if not self.slug: self.slug = slugify_persian(self.title) if not self.id: self.submite_date = timezone.now() self.update_time = timezone.now() super(Text, self).save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.slug: self.slug = slugify_persian(self.title) if not self.id: self.submite_date = timezone.now() self.update_time = timezone.now() parsed_uri = urlparse(self.url) self.domain = '{uri.netloc}'.format(uri=parsed_uri) super(Link, self).save(*args, **kwargs)
def save(self, *args, **kwargs): if not self.slug: self.slug = slugify_persian(self.name) super(Jaryanak, self).save(*args, **kwargs)