Django

Code

Ticket #4441 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

minor regroup optimization

Reported by: ferringb@gmail.com Assigned to: adrian
Milestone: Component: Template system
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

For template tag such as

{% regroup records by category as categories %}

the internal lookup/rendering is implemented as a var resolve of 'var.category', with the calling context dropped; in other words, code is forcing an uneeded lookup for every iteration of regroup; following patch cuts out the uneeded 'var.' lookup.

Attachments

simplify-regroup.patch (1.0 kB) - added by ferringb@gmail.com on 05/31/07 01:06:47.

Change History

05/31/07 01:06:47 changed by ferringb@gmail.com

  • attachment simplify-regroup.patch added.

05/31/07 07:03:59 changed by mtredinnick

  • needs_better_patch changed.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • needs_docs changed.

I can't see any problems with this, since you're correct that it doesn't reference the calling context, so name clashes aren't a problem.

I'll commit it tomorrow morning (too tired right now) if nobody beats me to it.

05/31/07 10:32:37 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [5392]) Fixed #4441 -- Made a small optimization to the regroup template tag implementation. Thanks, ferringb@gmail.com


Add/Change #4441 (minor regroup optimization)




Change Properties
Action