Hi.

What am I doing wrong, I do not get form-values filled in properly when
editing objects.

It works for (as far as I can see) everything, except datetime fields
and foreign keys.

Thanks for support


I have a model, that contains the following:

--- cut ---
class Case(meta.Model):
        customer = meta.ForeignKey(Customer)
        opened = meta.DateTimeField()
        reason = meta.CharField(maxlength=50)
        description = meta.TextField()
--- cut ---

when I output the thing with a generic view (like this):

--- cut ---
(r'^updatecase/(?P<object_id>\d+)/?$',
'django.views.generic.create_update.u
pdate_object', dict(case_dict, post_save_redirect="/support/"))
--- cut ---

and the cases_form.html:

--- cut ---
<label for=\"id_customer\">Customer:</label>
{% if form.customer.errors %}*** {{ form.customer.errors|join:", " }}{%
endif %}
{{ form.customer }}

<label for=\"id_description\">Description:</label>
{% if form.description.errors %}*** {{ form.description.errors|join:",
" }}{% endif %}
{{ form.reason }}

<label for=\"id_opened_date\">Opened at Date:</label>
{% if form.opened_date.errors %}*** {{ form.opened_date.errors|join:",
" }}{% endif %}
{{ form.opened_date }}
--- cut ---

Reply via email to