Opened 17 years ago

Closed 16 years ago

#5517 closed (invalid)

[newforms-admin] allow defining media on base forms

Reported by: Petr Marhoun <petr.marhoun@…> 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)

media-for-base-forms.diff (2.6 KB ) - added by Petr Marhoun <petr.marhoun@…> 17 years ago.

Download all attachments as: .zip

Change History (4)

by Petr Marhoun <petr.marhoun@…>, 17 years ago

Attachment: media-for-base-forms.diff added

comment:1 by Simon G <dev@…>, 16 years ago

Summary: [newforms-admin] - media for base forms[newforms-admin] allow defining media on base forms
Triage Stage: UnreviewedDesign decision needed

comment:2 by jkocherhans, 16 years ago

Keywords: nfa-someday added

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.

comment:3 by jkocherhans, 16 years ago

Resolution: invalid
Status: newclosed

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.
Back to Top