Opened 14 years ago
Closed 12 years ago
#14516 closed New feature (fixed)
Extract methods from removetags and slugify template filters
Reported by: | romainh | Owned by: | ik |
---|---|---|---|
Component: | Template system | Version: | |
Severity: | Normal | Keywords: | striptags removetags slugify refactor |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Like striptags
template filter, removetags
and slugify
should rely on external methods located in django.utils
.
removetags
method should live in django.utils.html
like striptags
.
Those features are often used elsewhere than in templates.
Attachments (2)
Change History (12)
comment:1 by , 14 years ago
Needs documentation: | set |
---|---|
Needs tests: | set |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 14 years ago
Owner: | changed from | to
---|
by , 14 years ago
Attachment: | 14516.diff added |
---|
comment:3 by , 14 years ago
Has patch: | set |
---|---|
Needs tests: | unset |
comment:4 by , 14 years ago
milestone: | 1.3 |
---|
comment:5 by , 14 years ago
milestone: | → 1.4 |
---|
comment:6 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
by , 14 years ago
Attachment: | 14516.removetags-slugify-utils.diff added |
---|
comment:7 by , 14 years ago
Easy pickings: | unset |
---|
I moved Slugify to django.utils.text
. I'm unsure whether this needs to be documented since currently only the "stable" modules are: http://docs.djangoproject.com/en/dev/ref/utils/
Perhaps the doc should be updated to include all (or some) other "non-stable" modules and the "stable" modules should be highlighted as such.
comment:3 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I agree with the reporter that those templatetags should also be available as normal python functions.
django.utils.html
is probably a good home forremovetags
, howeverslugify
is not really an HTML thing so it should be in another module (to be determined).Removing from the 1.3 milestone since we're pretty close to releasing it, and this can be assimilated as a new feature request. It's easy enough to live with using those templatetags for the moment.