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 hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page