Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-simple-viewset-0.1.11.tar.gz (8.3 kB view details)

Uploaded Source

File details

Details for the file django-simple-viewset-0.1.11.tar.gz.

File metadata

File hashes

Hashes for django-simple-viewset-0.1.11.tar.gz
Algorithm Hash digest
SHA256 56ec9ac1bdc3b112d7e4f0e7cd93b478f8f9af844e592766dcb19fd244ddef6d
MD5 0e6dafd0414a771c014202615ce30b7d
BLAKE2b-256 5240f874020810e8948107c11ee53f8add930f5bdd349b62d5cd27b5948699be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page