Simple viewset for models CRUD operations
Project description
Simple viewset for models CRUD operations.
# myapp/models.py
from django.db import models
class MyModel(models.Model):
...
class Meta:
...
default_permissions = ('add', 'change', 'delete', 'read')
# myapp/views.py
from viewset import ModelViewSet
from .models import MyModel
class MyModelViewSet(ModelViewSet):
model = MyModel
# myapp/urls.py
from django.conf.urls import include
from myapp.views import MyModelViewSet
urlpatterns = [
url(r'', include(MyModelViewSet().urls())),
]
# settings.py
INSTALLED_APPS = [
'simple_viewset',
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-simple-viewset-0.1.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 906cfbbfc272b6858753433dc4a7e999033a6125baaf5676529b9ae8542008d7 |
|
MD5 | f988fd5f52303ad819553f101c585c4d |
|
BLAKE2b-256 | fe00b820d68589749f599e04730aa71e7868ed5af3b88a78d55d0530a99e02a9 |