Hi,

Like Andreas is saying the only way to define the default widgets is to use
a form - and the simplest way to define a form is to use a ModelForm.

When you use Django you should do best by trying to work WITH the framework
instead of working against it. Forms are used for connecting templates with
model instances - that's the way django wants it to be. You would have
spent less time by using a ModelForm (which is like 5 lines of code) - than
searching for some other way of doing it. Really try to look at the way
django handles information and you will see that forms make sense in your
usecase.

Regards,

Andréas

2018-03-20 13:12 GMT+01:00 Cictani <[email protected]>:

>
> Without a form you can't get the Widget which is used by default. Are the
> fields always the same? If yes you could create a ModelForm on the fly and
> render the fields manually.
>
> Best regards,
>
> Andreas
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/ad20b07a-bf75-4032-9d52-ace38e7b8125%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ad20b07a-bf75-4032-9d52-ace38e7b8125%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCfompEMHq-nB5bQQyicCFrxPcN-XBvtvFXsH34jozi%2B%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to