i want use filerimagefield
in 1 of model field , want user edit outside admin area when try load it, widget doesn't work correctly , in browser console , error in javascript generated:
uncaught typeerror: cannot read property 'jquery' of undefined
in here:
<script type="text/javascript" id="id_featured_image_javascript"> django.jquery(document).ready(function(){ var plus = django.jquery('#add_id_featured_image'); if (plus.length){ plus.remove(); } // delete javascript once loaded avoid "add new" link duplicates django.jquery('#id_featured_image_javascript').remove(); }); </script>
the field in model defined this:
article_image = filerimagefield(db_column="article_image", verbose_name=_('article image'), related_name='ipp_article_image')
the field appears this:
do have idea why can't use field widget outside admin? need set configuration this?
thank :)
first of all, add {{ form.media }}
in html file, after tag <form>
, {% csrf_token %}
. extend media class in modelform
of forms.py explained steinrobert on github issue: https://github.com/divio/django-cms/issues/6028. works perfect! stein!
Comments
Post a Comment