Opened 6 years ago

Last modified 23 months ago

#9757 new Cleanup/optimization

Make IfNode a baseclass for other if nodes to subclass

Reported by: Alex 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

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.

Change History (7)

comment:1 Changed 6 years ago by emulbreh

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

#7806 has a ConditionalNode in django.template.utils that does exactly that.

comment:2 Changed 6 years ago by Alex

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 Changed 6 years ago by jacob

  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 4 years ago by lukeplant

  • Severity set to Normal
  • Type set to Cleanup/optimization

comment:5 Changed 3 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:6 Changed 3 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:7 Changed 23 months ago by jonathanslenders

Note: See TracTickets for help on using tickets.
Back to Top