Closed artofhuman closed 10 years ago
Hi, I put this into a templatetags/foo.py
:
# -*- coding: utf-8 -*-
import floppyforms as forms
from django import template
from django.db import models
class Feedback(models.Model):
comment = models.CharField(max_length=50)
class FeedbackForm(forms.ModelForm):
class Meta:
model = Feedback
register = template.Library()
@register.inclusion_tag('_feedback_form.html', takes_context=True)
def feedback_form(context):
form = FeedbackForm({})
return {'form': form}
And then called a template with the following content:
{% load foo %}
{% feedback_form %}
The result I get is this:
<input id="id_comment" maxlength="50" name="comment" type="text" />
So everything seem to work fine for me. Sorry that I cannot reproduce, maybe you have more information that I can take into account for further investigations.
Got error
But if render as
Thats work