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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f38209379a5765902d36bf9e1fe09fb3606d6904635af7b28ec398b59e7b7748 |
|
MD5 | 5208a70d01e24968e41e1a018ce2ccdc |
|
BLAKE2b-256 | 136a051156f039df41fbc24cc0993ba4041c499c935ba9a16c740eb39d9c5c04 |