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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd0f4394a48d288ceca8aa9405c35ddb2b18ad524d30ecc6c21e430b59aa9046 |
|
MD5 | 2ff5a3691a63b163c7b022296b3bb2a5 |
|
BLAKE2b-256 | 72a5c88bb488d735559f9e06210d3e1d52e0ab0a53212444740540cbcba793c3 |