Skip to main content

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.

![demo](https://raw.githubusercontent.com/wiki/Canon11/dj-cref/images/djcref.gif)


## 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.

Files for dj-cref, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size dj-cref-0.0.8.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page