Saturday, March 30, 2013

Re: Help, ckeditor not rendering in form

I figured it out.
In my index.html file, I had to add {{ form.media }}

On Saturday, March 30, 2013 12:21:52 PM UTC-4, frocco wrote:
Hello,

My form is not based on a model, form.value is not showing the editor.

Thanks for the help.

class RebateForm(forms.Form):
    item = forms.CharField(max_length=50, required=True)
    category = forms.ModelChoiceField(queryset=Category.objects.all())
    value = forms.CharField(widget=CKEditorWidget())

    def save(self):
        return do_rebate(self)



<div class="form">
    {{ form.errors }}
        <form action="." method="POST">
            {% csrf_token %}
            <table>
                <tr>
                    <td>Item to find</td>
                    <td>{{ form.item }}</td>
                </tr>
                <tr>
                    <td>Category to find</td>
                    <td>{{ form.category }}</td>
                </tr>
                <tr>
                    <td>Value to show user</td>
                    <td>{{ form.value }}</td>
                </tr>

            </table>
            <p><input type="submit" value="Start Update" /></p>
        </form>
</div><!-- form -->

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment