Answer the question
In order to leave comments, you need to log in
Django translit categories?
class Category(models.Model):
title = models.CharField(max_length=200)
url = models.CharField(max_length=200,blank=True, null=True)
parent = models.ForeignKey('Category',blank=True, null=True)
description=models.CharField(max_length=200,blank=True, null=True)
path=models.CharField(max_length=200,blank=True, null=True)
metadesc=models.CharField(max_length=200,default='',blank=True, null=True)
published=models.BooleanField(default=True)
position=models.IntegerField(default=0)
def __str__(self):
return self.title
def save(self, *args, **kwargs):
url=slugify(self.title, 'ru')
self.url = url
super(Category, self).save(*args, **kwargs)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question