I hen you define a ‘manual Form’ you can use the attribute’template_name’ to define the default template to be used for the {{form}} item.
Is there an equivalent to be used when using the Generic CreateView classes - using CreateView and siblings would reduce my code base significantly but I don’t want to use the default table layout.
any assistance appreciated.
In your view, you can identify what form is being used (the form_class attribute). That form can use your custom template.
Thanks Ken,
I will try that when I get home.
That attribute isn’t well documented - acorrding to the docs the CreateView only has ‘’model’’ and template_suffix attributes and no information about other attributes or methods that can be overriden.
Is there a definitive set of documentation as to what attributes and methods exist and what they do Or are we expected to dig through all of the mixins and class heirarchies and experiment ?
The visualiser doesn’t really help me here - knowing the call order is useful only if you already understand how all the attributes are used and what they all mean.
I agree - the CBV docs do expect you to work your way through the hierarchy.
(Side note:I’m not sure I understand what “visualizer” you’re referring to here.)
There are two external sources that I always recommend to people who are trying to wrap their head around the CBV structure:
They have been invaluable to me both as quick-reference material and to enhance my understanding of how those views work.
Thanks for those two links - very useful.