Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#36306 closed New feature (wontfix)

Allow simple_tag to parse @/:/- attributes

Reported by: Giannis Terzopoulos Owned by: Giannis Terzopoulos
Component: Template system Version: dev
Severity: Normal Keywords:
Cc: Carlton Gibson, Adam Johnson Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'm following up on the forum discussion: https://forum.djangoproject.com/t/proposal-allow-simple-tag-to-parse-attributes/36769

I think a sensible first step is trying an opt-in argument as Adam suggested, e.g., allow_all_attrs=True or perhaps allow_all_html_attrs=True.

For implementation details, I propose:

  1. Whitelisting common punctuation characters (@, :, -) for attribute names
  2. Making these attributes accessible directly (only) from kwargs, such as kwargs["@hello"]

Change History (3)

comment:1 by Giannis Terzopoulos, 6 months ago

Owner: set to Giannis Terzopoulos
Status: newassigned

comment:2 by Natalia Bidart, 6 months ago

Component: UncategorizedTemplate system
Resolution: wontfix
Status: assignedclosed
Version: dev

Hello Giannis, thanks a lot for opening this ticket and sharing the idea in the forum!

I took a look at the related forum thread, and while I think you are following the right procedure, I feel there is not enough consensus around this yet. As far as I can tell, only Adam has expressed support, and the use case and overall value of the feature still feel a bit unclear (at least to me).

I'm going to close this ticket as wontfix for now, but I'm definitely happy to revisit and reopen it if the idea gains more traction or if there's a clearer picture of the need and benefit. I'll also cross-post in the forum to invite more discussion and see if we can get a broader sense of interest.

Thanks again for taking the time to bring this up!

comment:3 by Natalia Bidart, 6 months ago

Cc: Carlton Gibson Adam Johnson added
Note: See TracTickets for help on using tickets.
Back to Top