Hi All
I got very excited when I read about the upcoming template based widgets, it is something that is really needed. I would like to hear your comments on a proposal I have that should only be a couple of lines to add but would add a massive usability boost.
I propose that we add the concept of "template sets", that gives us the ability to switch between sets of widget templates on a global or per form level.
Taking Bootstrap as an example; you have a required structure for stacked forms another for inline forms and in v4 another for custom forms. The actual widget rendering for say a RadioSelect is different in all situations. You could manually change widget templates for each different situation etc, but...
Imagine if you could simply say:
class MyForm:
class Meta:
template_set = 'bootstrap_inline' # or 'admin', 'bootstrap_stacked', 'foundation', 'skeleton', 'uikit',..
and the required widget templates would automatically be used.
3rd party applications would quickly popup with template sets for Bootstrap, Foundation, Skeleton, UiKit etc and Django will automatically generate forms for that particular framework.
To implement this would be as easy as injecting an additional templates directory based on the value of template_set. Not setting template_set would mean the default template resolution applies.
I believe this would make Django truly framework agnostic and easy to implement any framework of your choosing or switch from one framework to another...
Your thoughts on 1) concept and 2) implementation?
Regards
Gert Steyn