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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca36e7f8483f64c1df4e0cea3ce2fc8a1cbaa7174287d60a548b05def06a9d20 |
|
MD5 | eb4e76e2ed599ef93deb41c266cd9d33 |
|
BLAKE2b-256 | a9dd4a330f9810322ac8061af1d93b4bf99753dcc516ac018d0513286a8f2a04 |