Opened 18 years ago
Closed 18 years ago
#5517 closed (invalid)
[newforms-admin] allow defining media on base forms
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Forms | Version: | newforms-admin |
| Severity: | Keywords: | media, form_for_model, nfa-someday | |
| Cc: | Triage Stage: | Design decision needed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I think it should be possible to define media on base form. Example from the attached patch:
>>> class FormWithMedia(BaseForm):
... class Media:
... js = ['form.js']
... css = {'all': ['form.css']}
>>> CategoryFormWithMedia = form_for_model(Category, form=FormWithMedia)
>>> f = CategoryFormWithMedia()
>>> print f.media
<link href="form.css" type="text/css" media="all" rel="stylesheet" />
<script type="text/javascript" src="form.js"></script>
Attachments (1)
Change History (4)
by , 18 years ago
| Attachment: | media-for-base-forms.diff added |
|---|
comment:1 by , 18 years ago
| Summary: | [newforms-admin] - media for base forms → [newforms-admin] allow defining media on base forms |
|---|---|
| Triage Stage: | Unreviewed → Design decision needed |
comment:2 by , 18 years ago
| Keywords: | nfa-someday added |
|---|
comment:3 by , 18 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
I don't think this is valid since the addition of ModelForms. form_for_model is deprecated.
Note:
See TracTickets
for help on using tickets.
This seems reasonable enough to me, but I haven't really used the Media code yet. Russ is probably in the best position to make the call on this. Tagging as nfa-someday for now.