Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#13257 closed (wontfix)

label_tag syntax check should also check for blank fields and show no syntax

Reported by: jkatzer Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords: label_tag
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

if for some reason you would like a field in the admin to have a blank label, such as for an extra address field, the admin should not punctuate your empty field with syntax.

yes, i know you might just call that field address2 or anything else, but its your admin and you should be able to do whatever you feel with it. also, this makes sense for the front end form generation, which is where the change needs to be made.

i was trying to do the simple thing by just hacking the template (since this is just presentation after all), but then i found the line that would need to be changed and thought it was worth proposing here...

diff attached...

Attachments (1)

proposed_change.diff (401 bytes ) - added by jkatzer 15 years ago.
hacky fix.…

Download all attachments as: .zip

Change History (6)

comment:1 by jkatzer, 15 years ago

Needs tests: set

comment:2 by jkatzer, 15 years ago

Has patch: unset
Needs tests: unset

disregard the patch... that code does not run unless label_syntax is used (which i assumed admin used)

comment:3 by jkatzer, 15 years ago

Has patch: set
Needs tests: set

ok this new patch is really hacky, but it gets the job done for me....

by jkatzer, 15 years ago

Attachment: proposed_change.diff added

hacky fix....

comment:4 by Russell Keith-Magee, 15 years ago

milestone: 1.2
Resolution: wontfix
Status: newclosed

Am I missing something that isn't possible by saying " f3 = forms.IntegerField(label=) "?

comment:5 by Russell Keith-Magee, 15 years ago

Lets try that again:

>>> class MyForm(forms.Form):
...     f1 = forms.IntegerField()
...     f2 = forms.IntegerField(label='test field')
...     f3 = forms.IntegerField(label='')

>>> f = MyForm()
>>> print f.as_p()
<p><label for="id_f1">F1:</label> <input type="text" name="f1" id="id_f1" /></p>
<p><label for="id_f2">test field:</label> <input type="text" name="f2" id="id_f2" /></p>
<p> <input type="text" name="f3" id="id_f3" /></p>
Note: See TracTickets for help on using tickets.
Back to Top