Unique Slug Generator


How would you go about using the unique slug generator with prepopulated fields in the admin?

For example if the model was:

post_id = models.Autofield(primary_key=True)

title = models.CharField(max_length=150)

slug = models.SlugField(max_length=150, unique=True)

Many thanks for all the hard work on the tutorials.

 

Category: Django
Asked at Aug. 23, 2018, 10:08 a.m. by nimbusdt

I am a bit confused what you are asking. You say in the admin but your model should work in the admin just need to register it. Using admin.pay and putting admin.site.register('your model') - admin at Aug. 23, 2018, 11:54 a.m.

0 Answers