Opened 16 years ago
Last modified 12 years ago
#9757 new Cleanup/optimization
Make IfNode a baseclass for other if nodes to subclass
Reported by: | Alex Gaynor | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | 1.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Pull Requests: | How to create a pull request | ||
Description ¶
Right now any other if
type node that wants to exist needs to re-implement all the rendering logic of the if tag, in addition to the conditional it wants to use. To simplify this we could make IfNode do all of the logic to determine whether it evalueates true or not into a seperate method, and then subclasses could just overide the init and that mehtod.
According to the ticket's flags, the next step(s) to move this issue forward are:
- To provide a patch by sending a pull request. Claim the ticket when you start working so that someone else doesn't duplicate effort. Before sending a pull request, review your work against the patch review checklist. Check the "Has patch" flag on the ticket after sending a pull request and include a link to the pull request in the ticket comment when making that update. The usual format is:
[https://github.com/django/django/pull/#### PR]
.
Change History (7)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Great, I hadn't noticed that in that behemoth of that patch :P . I'm going to leave this open still as a marker ticket for this, even if it will be handled as a part of that.
comment:3 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:4 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Cleanup/optimization |
comment:7 by , 12 years ago
Please review this ticket first: https://code.djangoproject.com/ticket/20434#comment:6
#7806 has a
ConditionalNode
indjango.template.utils
that does exactly that.