Using Dojango and Django widgets

13 views
Skip to first unread message

Wiiboy

unread,
Jan 18, 2010, 11:54:16 PM1/18/10
to dojango-users
Hi guys,
Can I use dojango and django standard widgets in the same form (with
model forms too)? I.e.

from dojango import forms
import django.forms

class MyModelForm(forms.ModelForm):
dojango_field = forms.CharField()
django_field = django.forms.CharField()

klipstein

unread,
Jan 19, 2010, 5:51:44 PM1/19/10
to dojango-users
Hi Wiiboy,

sure you can do that. The only thing I would do different is the
import:

from dojango import forms
from django import forms as normal_forms

But you have to care, that the normal model-field to form-field
mapping within dojango.forms.ModelForm is different to
django.forms.ModelForm. In the case of dojango.forms.ModelForm it is
mapping each model-field to a dojango form-field/widget, but you can
easily overwrite the fields where you want to use a different form
field (as you did in your example).

Another note: if you use a ModelForm you also have to define a Meta
class where you assign a model to the form.

Regards, Tobias

Wiiboy

unread,
Jan 20, 2010, 8:22:38 PM1/20/10
to dojango-users
Thanks Tobias =)

By the way, I noticed my emails about updates in this group are in
German. Not that I'm complaining (I like it: I'm learning German at
my high school), but is that me, or is it supposed to happen?

Julian Moritz

unread,
Jan 21, 2010, 2:41:21 AM1/21/10
to dojang...@googlegroups.com
Hi,

Wiiboy schrieb:

if you look at the google website of this group in "about this
group/�ber diese gruppe" the language is specified as

Sprache Deutsch

maybe its a group-wide spec, Tobias would you change that?

Regards/Sch�nen Gru�
Julian

klipstein

unread,
Jan 21, 2010, 2:46:56 AM1/21/10
to dojango-users
Should be changed now.
Reply all
Reply to author
Forward
0 new messages