On Tuesday 16 May 2017 12:05:59 Jani Tiainen wrote: > "rightway" to do things is to keep rendering (html) in the place where > it belongs to - in templates. That's the main functionality of > templates.
First, there's no single place to render HTML. Template rendering deals very poorly with nesting and recusion. The right place for those really is a progamming language. Second, forms don't have to be rendered as HTML, but I agree that rendering is in principle the job of a template (but not the only place). > Unfortunately traditionally Django forms have been doing things wrong > and pushed HTML rendering to Python code - bascially to change your > HTML you need to change Python code, which in production would mean > deploying site again. I've never experienced that as an issue (ok, maybe once). In the vast majority of cases, the changes needed to a form are not HTML related. And this brings me to the point you're not seeing: if a tag renders a piece of HTML correctly for the majority of the cases, then by all means use it. For the exceptions, you can use plain HTML. So, the reason I advised the bootstrap3 package, is that it produces the correct HTML 9 outof 10. Do I need it? No. Does it save me time? Yes, definitely. And it keeps structure of templates readable. -- Melvyn Sopacua -- 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/2662495.ivQWgKXhZU%40devstation. For more options, visit https://groups.google.com/d/optout.