📜  django admin slug 自动填充 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:41.454000             🧑  作者: Mango

代码示例1
#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'])