When I want to create new object from product
I got this error:
slugify() got an unexpected keyword argument 'allow_unicode'
This is my models:
class BaseModel(models.Model):
created_date = models.DateTimeField(auto_now_add=True)
modified_date = models.DateTimeField(auto_now=True,)
slug = models.SlugField(null=True, blank=True, unique=True, allow_unicode=True, max_length=255)
class Meta:
abstract = True
class Product(BaseModel):
author = models.ForeignKey(User)
title = models.CharField()
# overwrite your model save method
def save(self, *args, **kwargs):
title = self.title
# allow_unicode=True for support utf-8 languages
self.slug = slugify(title, allow_unicode=True)
super(Product, self).save(*args, **kwargs)
I also ran the same pattern for other app(blog) ,and there I didn't run into this problem. What's wrong with this app?