On Wed, Dec 8, 2010 at 10:49 AM, JeffH <holtzma...@gmail.com> wrote: > So I'm working along, everything's humming fine. Then I try to add a > record via the admin, and get the following: > > TemplateSyntaxError at /admin/expert/expertresponse/add/ > Caught AttributeError while rendering: 'unicode' object has no > attribute 'date' > > [snip] > > Template error > > In template c:\python26\lib\site-packages\django\contrib\admin > \templates\admin\includes\fieldset.html, error at line 12 > Caught AttributeError while rendering: 'unicode' object has no > attribute 'date' > 2 {% if fieldset.name %}<h2>{{ fieldset.name }}</h2>{% endif %} > 3 {% if fieldset.description %}<div > class="description">{{ fieldset.description|safe }}</div>{% endif %} > 4 {% for line in fieldset %} > 5 <div class="form-row{% if line.errors %} errors{% endif %} {% for > field in line %}{{ field.field.name }} {% endfor %} "> > 6 {{ line.errors }} > 7 {% for field in line %} > 8 <div{% if not line.fields|length_is:"1" %} class="field-box"{% > endif %}> > 9 {% if field.is_checkbox %} > 10 {{ field.field }}{{ field.label_tag }} > 11 {% else %} > 12 {{ field.label_tag }}{{ field.field }} > > I can add records via a ModelForm without problem, it just doesn't > work in the admin. > > As you probably surmised from the error, the admin is expecting a field attribute of type date on your model object (line?). Anyway, what is getting passed is an Unicode object, which obviously does not have the attribute (field) it is looking for.
I would guess that the problem lies somewhere in your admin file (admin.py). What are the contents of it? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.