Code

Opened 7 years ago

Closed 10 months ago

#5749 closed New feature (fixed)

Add field_name as a key on the _html_output dict

Reported by: SmileyChris Owned by: e0ne
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 SmileyChris 7 years ago.

Download all attachments as: .zip

Change History (9)

Changed 7 years ago by SmileyChris

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

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 4 years ago by russellm

  • Triage Stage changed from Design decision needed to Accepted

comment:3 Changed 3 years ago by gabrielhurley

  • Severity set to Normal
  • Type set to New feature

comment:4 Changed 3 years ago by julien

  • Easy pickings unset
  • Needs tests set

comment:5 Changed 2 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:6 Changed 10 months ago by e0ne

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

comment:7 Changed 10 months ago by e0ne

  • Owner changed from nobody to e0ne
  • Status changed from new to assigned

comment:8 Changed 10 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In 053de6131af83c63ec17d38578889c71de913d24:

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

Thanks SmileyChris for the suggestion.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.