Skip to content

Django generic views with PascalCase template paths containing model based folders

License

Notifications You must be signed in to change notification settings

wooyek/django-pascal-templates

Repository files navigation

django-pascal-templates

Django generic views with PascalCase template paths with model named folders.

https://github.com/wooyek/django-pascal-templates

https://img.shields.io/pypi/v/django-pascal-templates.svg?maxAge=2592000 https://img.shields.io/pypi/dm/django-pascal-templates.svg?maxAge=2592000

Usage

Replace your usual generic view imports with:

from pascal_templates.views import DetailView, CreateView, UpdateView, DeleteView, ListView

And in result get additional template_names allowing you to keep templates in folders named after your models:

names = [
   'some_app/somemodel_detail.html',
   'some_app/SomeModel/detail.html',   # This is what you get
 ]

In effect you can use a nice folder structure with templates that are easy to manage:

templates
├── SomeModel
│   ├── detail.html
│   ├── form.html
│   └── list.html
├── SomeOtherModel
│   ├── detail.html
│   ├── form.html
│   └── list.html

About

Django generic views with PascalCase template paths containing model based folders

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages