You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

models.py 520B

12345678910111213141516171819
  1. from django.utils import six
  2. from django.db import models
  3. from oscar.models.fields import AutoSlugField
  4. class SluggedTestModel(models.Model):
  5. title = models.CharField(max_length=42)
  6. slug = AutoSlugField(populate_from='title')
  7. class ChildSluggedTestModel(SluggedTestModel):
  8. pass
  9. class CustomSluggedTestModel(models.Model):
  10. title = models.CharField(max_length=42)
  11. slug = AutoSlugField(populate_from='title',
  12. separator=six.u("_"),
  13. uppercase=True)