Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jambonrose/djangocon2013-otwcbv
The code used for "Overcoming Troubles with Class-Based (Generic) Views," my presentation at DjangoCon 2013.
https://github.com/jambonrose/djangocon2013-otwcbv
Last synced: 28 days ago
JSON representation
The code used for "Overcoming Troubles with Class-Based (Generic) Views," my presentation at DjangoCon 2013.
- Host: GitHub
- URL: https://github.com/jambonrose/djangocon2013-otwcbv
- Owner: jambonrose
- License: bsd-2-clause
- Created: 2013-09-17T17:38:09.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-11-08T00:36:28.000Z (about 9 years ago)
- Last Synced: 2023-04-01T03:12:32.067Z (over 1 year ago)
- Language: Python
- Size: 171 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Overcoming Troubles with Class-Based (Generic) Views
====================This repository contains the code used in my DjangoCon 2013 presentation. All other materials may be accessed [here](http://afrg.co/otwcbv/).
**NB**: To ease setup of this demonstration, the Django Secret Key has not been removed from the `settings.py` file. This site should therefore never be used for production purposes.
Setup
---------------------$ git clone https://github.com/jambonrose/djangocon2013-otwcbv.git djotwcbv
$ cd djotwcbv
$ ./manage.py syncdb
$ ./manage.py runserver 7777Navigate your preferred browser to `127.0.0.1:7777`.
Source Code Perusal
---------------------To make navigating the code easier, the project provides several tags. Each tag corresponds to a specific moment in the [presentation](https://speakerdeck.com/jambonrose/overcoming-troubles-with-class-based-generic-views)/[article](http://andrewsforge.com/article/overcoming-troubles-with-class-based-views/).
Any of the tags may be accessed with: `git checkout tagname`. For example: `git checkout cbgv-url-only`.
In order of appearance:
- `function-views`
- The site uses functions to process requests.
- `cbv`
- The site uses class-based views to process requests.
- `cbgv-basic`
- The site uses class-based generic views (in `bank/views.py`) to process requests, removing the necessity for `bank/forms.py`.
- `cbgv-url-only`
- The site uses class-based generic views in the URL mapping (`bank/urls.py`) to process requests, removing the necessity for `bank/views.py` (`bank/forms.py` still unnecessary).
- `cbgv-customized`
- The site achieves the goals set forth in the [presentation](https://speakerdeck.com/jambonrose/overcoming-troubles-with-class-based-generic-views)/[article](http://andrewsforge.com/article/overcoming-troubles-with-class-based-views/) by customizing class-based generic views in `bank/views.py` and overriding `ModelForm` functionality in `bank/forms.py`. This last tag is equivalent to head of `master`.