Opened 8 years ago

Closed 7 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: UI/UX:

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@…> 8 years ago.

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by Petr Marhoun <petr.marhoun@…>

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from [newforms-admin] - media for base forms to [newforms-admin] allow defining media on base forms
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 8 years ago by jkocherhans

  • 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 Changed 7 years ago by jkocherhans

  • Resolution set to invalid
  • Status changed from new to 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.
Back to Top