How to override the automatic slug in existing objects?

Imported a large database of objects, foolishly did not specify the correct field slug, in admin.py configured prepopulated_fields how to overwrite this field on the basis of the formula in prepopulated_fields ? our database more than 10 000 objects
June 10th 19 at 16:53
1 answer
June 10th 19 at 16:55
Solution
In General, who should:

from pytils.translit import slugify
from app.models import Yourmodel

objects = Yourmodel.objects.all()
for i in objects:
 i.slug = slugify(i.name+i.id)
 i.save()

Find more questions by tags Django