#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)
Change History (6)
comment:1 by , 15 years ago
Needs tests: | set |
---|
comment:2 by , 15 years ago
Has patch: | unset |
---|---|
Needs tests: | unset |
comment:3 by , 15 years ago
Has patch: | set |
---|---|
Needs tests: | set |
ok this new patch is really hacky, but it gets the job done for me....
comment:4 by , 15 years ago
milestone: | 1.2 |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Am I missing something that isn't possible by saying " f3 = forms.IntegerField(label=) "?
comment:5 by , 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>
disregard the patch... that code does not run unless label_syntax is used (which i assumed admin used)