First of all, notice the suggestion was to make the change on your *form*
class, not the model -- forms are where you can specify that a particular
widget + attributes should be used on a particular field.

Though it's also possible to do things in the template itself if you know
your way around the forms API. I've used this handy little library a few
times to do just that (since it knows its way around the forms API and lets
you do quite a bit of rendering customization in the template):

https://pypi.python.org/pypi/django-widget-tweaks

On Fri, Mar 18, 2016 at 11:17 AM, Stanislav Vasko <stanislav.va...@gmail.com
> wrote:

> Ufff, i hope there is another way. Something working so simple like
> passing data from View to Template with direct access like {{ company.name
> }} or {{ company.phone }}. I dont see the point why to modify Model and how
> it helps with styling form.
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> 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/f33ad8b5-af2a-417c-b572-e0b7973e2d4c%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f33ad8b5-af2a-417c-b572-e0b7973e2d4c%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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CAL13Cg_ovDYY9oxz8XwL%2BGPAL7i88U0gZ2RvZ0qkH_4xb%2B2P4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to