dojango x generic view

4 views
Skip to first unread message

Mauricio

unread,
Jan 4, 2010, 9:05:51 AM1/4/10
to dojango-users
Hello everyone
I am using generic views, but I can not associate a form using dojang
with a view.
There is something wrong in my code or I need to use a regular view?
Thanks


Eg

FORMS.PY

from dojango.forms import *

class addresstype_form( forms.Form):
name = CharField(max_length=30)

URL.PY

test_change = {
'model': Test,
'post_save_redirect': 'about:blank',
'login_required': True,
'form_class': test_form,
}

urlpatterns = patterns('',
...
(r'^test/update/(?P<object_id>\d+)/?$',
create_update.update_object, test_change),
)

klipstein

unread,
Jan 4, 2010, 9:32:24 AM1/4/10
to dojango-users
Hi Mauricio,

after a short sight I would say, that your code should work properly.
Don't know how you imported the test_form in "urls.py", but I assume
you've used the addresstype_form from forms.py.

In your example it should create something like the following input-
field:
<input type="text" dojoType="dijit.form.ValidationTextBox"/>

For further investigation I would need a more detailed problem
description + generated html-code or an error-message you maybe get.

Regards, Tobias

Mauricio

unread,
Jan 7, 2010, 1:46:39 PM1/7/10
to dojango-users
Thanks Tobias

Sorry for the delay in response ...
In fact, my original code refers to AddressType, forgot to change it
in the example.
What is happening is that when I try to associate the test_form in
test_change an error occurs.
If you allow me, sending a small example by email.
Thanks again

klipstein

unread,
Jan 7, 2010, 1:52:38 PM1/7/10
to dojango-users
just send it here. someone else could have the same problem.
Reply all
Reply to author
Forward
0 new messages