This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

django-lazydrf is a dirty magic applied to your models to generate automated Django Rest Framework endpoints.

Note that this is an experimental project. Use at your own risk and sadness.

TODO: Provide a complete README

Installation

pip install django-lazydrf

Usage

  1. Define a Django model as follows:

    from django.db import models
    from django.db.models import CharField
    
    from lazydrf.models import LDRF
    
    
    class Record(models.Model, metaclass=LDRF):
        """
        Defines a key/value record model.
        """
    
        #: Defines the key of the record.
        key = CharField(max_length=16, unique=True, blank=False, null=False)
    
        #: Defines the value of the record.
        value = CharField(max_length=64, blank=False, null=False, db_index=True)
    
        class Meta:
            """
            Defines Django model metadata.
            """
            app_label = "sample"
    
        class APIFields:
            """
            Defines fields related API metadata.
            """
            editable = ["key", "value"]
            ordering = ["key"]
            searching = ["key", "^value"]
    
        class APIFiltering:
            """
            Defines filtering related API metadata.
            """
            key = ["exact", "icontains", "startswith"]
            value = ["exact", "icontains", "startswith"]
    
        class APIViewset:
            pass
            #readonly = True
    
  2. Register all lazydrf models for a given Django application to the usual DRF router, like:

    from django.conf.urls import url, include
    from django.contrib import admin
    from rest_framework import routers
    
    from lazydrf.utils import register_app
    
    
    #: Defines the DRF router.
    Router = routers.DefaultRouter()
    
    ## Register model endpoints for the sample Django application:
    register_app("sample", Router)
    
    #: Defines URL patterns:
    urlpatterns = [
        url(r'^admin/', admin.site.urls),
        url(r"^", include(Router.urls)),
    ]
    
Release History

Release History

0.0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-lazydrf-0.0.1.tar.gz (7.9 kB) Copy SHA256 Checksum SHA256 Source Apr 16, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting