these were my models file before
class retailers(models.Model):
country = models.TextField()
category = models.TextField()
title = models.CharField(max_length=300)
slug = AutoSlugField(populate_from=['country', 'category', 'title'])
I added some data to it and The slug field successfully Auto populated it.
Now i added a new Field Shop and want to edit the Previous SLUG data to include the shop field as well, How can i do that ?
class retailers(models.Model):
shop = models.TextField()
country = models.TextField()
category = models.TextField()
title = models.CharField(max_length=300)
slug = AutoSlugField(populate_from=['country', 'shop', 'category', 'title'])
I tried the Following, but it didn’t work.
R = retailers.objects.filter(id = 1).update(slug = ['country', 'shop', 'category', 'title'])
R[0].slug
Output
"['country', 'shop', 'category', 'title']"
The output is not what i a looking for. Please Help