Alex Rivera | Logout

process the media class of a model form in django to a template

Asked 2009-12-29T16:59:03.280
9

I have a form looking like this:

class MarketingActionForm(forms.ModelForm):

    contact = ManyToManyByLetter(Contact, field_name="first_name")
    #contact = AjaxManyToManyField(Contact, DICT_LOOKUP)

    class Meta:
        model = MarketingAction
        exclude = ('created_by',)

    class Media:
            js = (
                settings.ADMIN_MEDIA_PREFIX + "js/SelectBox.js",
                settings.ADMIN_MEDIA_PREFIX + "js/SelectFilter2.js",
                settings.MEDIA_URL + "js/jquery.js",
                settings.MEDIA_URL + "js/ajax_filtered_fields.js",
            )

I process this form with a view to the template. Now I`m wondering why the Media class is not automatically processed in the template, at least it does not show up in the .html output.

Therefore i want to ask what i have to do in order that the media definitions will show up in the .html output.

I did not find it in the django .docs. Therefore i thought it will be processed automatically.

Edit
Report

1 Answer

0

I believe the Media class is used in the admin, by classes which subclass admin.ModelAdmin

http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-media-definitions

answered 2009-12-29T19:02:09.553

Your Answer