Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

autoslugfield django 3

# models.py

from django.db import models

from django_extensions.db.fields import AutoSlugField

class MyModel(models.Model):
    title = models.CharField(max_length=42)
    slug = AutoSlugField(populate_from=['title', 'description', 'get_author_name'])

Source by django-extensions.readthedocs.io #
 
PREVIOUS NEXT
Tagged: #autoslugfield #django
ADD COMMENT
Topic
Name
1+4 =