SlugField format not enforced
|Reported by:||Daniel Pope <dan@…>||Owned by:||nobody|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
models.SlugField is documented as "a short label for something, containing only letters, numbers, underscores or hyphens."
However, with forms.ModelForm and newforms-admin, this formatting is not enforced. The ModelForms documentation instead states that models.SlugField is represented by a forms.CharField (ie. validation occurs).
models.SlugField.formfield() should return a forms.RegexField suitable for validating the field as a slug (and the ModelForms documentation should reflect this).
Change History (11)
comment:1 Changed 6 years ago by Daniel Pope <dan@…>
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:3 Changed 6 years ago by jacob
- milestone set to 1.0
- Triage Stage changed from Unreviewed to Accepted