How it works...

If you look at the administration form for ideas now, you will see something like this:

There are two changes here:

  • The category selection is now using a widget with multiple checkboxes.
  • The picture field is now rendered with a specific template, showing a preview of the image and help text with preferred file types and dimensions.

What we did here, was we overwrote the model form for the idea and modified the widget for the categories and the template for the picture field.

The default form renderer in Django is "django.forms.renderers.DjangoTemplates", and it only searches for the templates in app directories. We changed it to "django.forms.renderers.TemplatesSetting" to also have a look in the templates under DIRS paths.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.178.133