Opened 9 years ago

Closed 3 years ago

#5749 closed New feature (fixed)

Add field_name as a key on the _html_output dict

Reported by: Chris Beaven Owned by: Ivan Kolodyazhny
Component: Forms Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Just a small extension which I have found useful.

The use case is customising a field so that the row can be ided. For example:

class MyForm(Form):
    def as_p(self):
        return self._html_output(u'<p id="p_%(field_name)s">%(label)s %(field)s%(help_text)s</p>', u'%s', '</p>', u' %s', True)

Attachments (1)

5749.patch (1.0 KB) - added by Chris Beaven 9 years ago.

Download all attachments as: .zip

Change History (9)

Changed 9 years ago by Chris Beaven

Attachment: 5749.patch added

comment:1 Changed 9 years ago by Simon G <dev@…>

Has patch: set
Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 6 years ago by Russell Keith-Magee

Triage Stage: Design decision neededAccepted

comment:3 Changed 6 years ago by Gabriel Hurley

Severity: Normal
Type: New feature

comment:4 Changed 6 years ago by Julien Phalip

Easy pickings: unset
Needs tests: set

comment:5 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:6 Changed 3 years ago by Ivan Kolodyazhny

I've updated patch and create test for it: https://github.com/django/django/pull/1610

comment:7 Changed 3 years ago by Ivan Kolodyazhny

Owner: changed from nobody to Ivan Kolodyazhny
Status: newassigned

comment:8 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 053de6131af83c63ec17d38578889c71de913d24:

Fixed #5749 -- Added field_name as a key in the _html_output dict

Thanks SmileyChris for the suggestion.

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