Opened 17 years ago
Closed 17 years ago
#5085 closed (fixed)
Make the default value of slug_field be 'slug'
Reported by: | Owned by: | Jacob | |
---|---|---|---|
Component: | Generic views | Version: | dev |
Severity: | Keywords: | slug_field | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The default value for the parameter slug_field in the functions create_update.delete_object, create_update.delete_object, date_based.object_detail and list_detail.object_detail should be 'slug'. 'slug' is a common field name for SlugFields, and in case you choose that field name, your url configuration can be substantially simpler (for example, you can share the extra_context dict between an object_list and object_detail for the same table). There is little cost to making this the default, in order to enable slug-based matching, you will still have to pass a slug parameter.
Attachments (2)
Change History (7)
comment:1 by , 17 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 17 years ago
Triage Stage: | Design decision needed → Accepted |
---|
Good idea! Could somebody include a patch, including changes to the documentation?
by , 17 years ago
Attachment: | set-default-value-of-slug_field-to-slug.diff added |
---|
Add default values to generic view parameters and update documentation
by , 17 years ago
Attachment: | remove-explicit-specification-of-slug_field-from-website.diff added |
---|
Removed the explicit specification of slug_field from the urls.py of the weblog of the website
comment:3 by , 17 years ago
Has patch: | set |
---|---|
Needs documentation: | unset |
Triage Stage: | Accepted → Ready for checkin |
comment:4 by , 17 years ago
The second patch isn't worth applying, since it doesn't hurt to leave things as they are (and updating the website source is more involved than trunk). So this bug will be closed once the first patch goes in.
comment:5 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Seems to make common sense. Yes?