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.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 813663186dea4a327fbc4ffc90c6d8c120f5f159ca359265b9b5213e25b1282c |
|
MD5 | 9008889f3ae1b1812a38e97c043e8779 |
|
BLAKE2b-256 | 6b55592c0f158c4729324204325fa6c4dd4fa5ea47c2485edc5687ecfef9e44b |