The django generic view output unit
Project description
# dj-cref
The output unit of Django generic view.
## Description
This is the Python package whose name is **dj-cref** .
**dj-cref** outputs a template of django generic view you wanted.

## Features
### Output kinds
- View
- FormView
- CreateView
- UpdateView
- DeleteView
- DetailView
- TemplateView
- ListView
- RedirectView
## Requirement
- Python3
## Usage
### Arguments
* <code>-type [kind of view]</code> : Which type of generic view to output.
* <code>--initial</code> : Whether to include import statements.
### Example
Case1
```
$ dj-cref -type FormView
class MyFormView(FormView):
# template_name = 'my_template.html'
# form_class = 'MyForm'
# success_url = '/my/success'
def dispatch(self, request, *args, **kwargs):
super().dispatch(request, *args, **kwargs)
# please implement here
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
...
```
Case2
```
$ dj-cref -type FormView --initial
from django.views import FormView
class MyFormView(FormView):
# template_name = 'my_template.html'
# form_class = 'MyForm'
# success_url = '/my/success'
def dispatch(self, request, *args, **kwargs):
super().dispatch(request, *args, **kwargs)
...
```
## Installation
```
$ pip install dj-cref
```
## Author
[@Canon11](https://github.com/Canon11/)
The output unit of Django generic view.
## Description
This is the Python package whose name is **dj-cref** .
**dj-cref** outputs a template of django generic view you wanted.

## Features
### Output kinds
- View
- FormView
- CreateView
- UpdateView
- DeleteView
- DetailView
- TemplateView
- ListView
- RedirectView
## Requirement
- Python3
## Usage
### Arguments
* <code>-type [kind of view]</code> : Which type of generic view to output.
* <code>--initial</code> : Whether to include import statements.
### Example
Case1
```
$ dj-cref -type FormView
class MyFormView(FormView):
# template_name = 'my_template.html'
# form_class = 'MyForm'
# success_url = '/my/success'
def dispatch(self, request, *args, **kwargs):
super().dispatch(request, *args, **kwargs)
# please implement here
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
...
```
Case2
```
$ dj-cref -type FormView --initial
from django.views import FormView
class MyFormView(FormView):
# template_name = 'my_template.html'
# form_class = 'MyForm'
# success_url = '/my/success'
def dispatch(self, request, *args, **kwargs):
super().dispatch(request, *args, **kwargs)
...
```
## Installation
```
$ pip install dj-cref
```
## Author
[@Canon11](https://github.com/Canon11/)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dj-cref-0.0.8.tar.gz
(3.1 kB
view details)
File details
Details for the file dj-cref-0.0.8.tar.gz.
File metadata
- Download URL: dj-cref-0.0.8.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e29f5a5f16fb7430478f8eb7d40493c0649468aba36a07080072c539aa206d01
|
|
| MD5 |
1d01fb469974965f181bec5ebbb97384
|
|
| BLAKE2b-256 |
1db8821e99205e88d833d288c4257100cebe6f1c8df6fc8c44f1232cec08d2a3
|