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.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1e73281c96d1e9534ab7279cc02b883704b5dea03cf7afef994a4df90f58b3c |
|
MD5 | 6f68f42b2e59e5e59a54d31fc9c62a83 |
|
BLAKE2b-256 | 2280afea7181247524b1a2ba57362414e5264630606a84b144feaa9e5d10f742 |