#33431 closed Bug (duplicate)
Regroup Violates Syntax Expectations
Reported by: | Caleb White | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | 3.2 |
Severity: | Normal | Keywords: | regroup |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I would like to re-report the following issue from 16 years ago: https://code.djangoproject.com/ticket/1461
I hope that it is obvious why it would be useful to dynamically resolve this variable.
I spent a long time trying to figure out why group_key.grouper
was always None
for me, and it's because the variable I'm using as the grouping token is being treated as a string rather than a variable.
Honestly this seems like a serious design flaw in the template language itself - why are unquoted tokens ever treated as strings? How is the user of the template language supposed to know whether a given token will be resolved as a variable or treated as a literal string? This is very confusing and I can't find any explanation in the documentation of why this is the case. I can't think of any benefit gained by all of this ambiguity, so I imagine the only reason not to change this is going to be backwards compatibility.
As far as I can tell, this bug is present in every version of Django.
Change History (2)
comment:1 by , 3 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:2 by , 3 years ago
Also Caleb, if you do follow-up, please include a minimal example demonstrating the issue, otherwise you're asking folks to do a lot of archeology in order to see the problem, and that reduces your chances of getting a timely response. Thanks.
We ask that you not create duplicate tickets but rather write to the DevelopersMailingList to make your case to revisit the wontfix decision.