initial_data.yaml
fixture populate a SlugField with a slug containing a period and not generate an error?Here's an excerpt of the model:
class Project(models.Model):
slug_code = models.SlugField(max_length=15)
Here's the applicable initial_data.yaml
excerpt:
- model: myapp.project
pk: 1
fields:
slug_code: TIDE.024
The yaml fixture initial_data.yaml
is installed without any errors. When I log into the Admin and look at the Project model, I can see that the SlugField slug_code
contains TIDE.024
, but when I change the slug_code
field to say TIDE.025
the Admin generates the following error:
Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.
The value in the SlugField
is only checked in forms, not in the database.