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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1dd99b0b1f3832a915816f0b11b091ff35af6f3c67a5d0a08bb3d3114d0f865 |
|
MD5 | c3d8f752dd44c47aff38e98ca100cde9 |
|
BLAKE2b-256 | a579a93604c22b9a005ab9d4a71b778a9e8a685acbb677431b2c87a279e2ef5e |