Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Define views, serializers and routers as the PumpWood format

Project Description

Extends Django and Rest FrameWork exceptions in order to give a better detail over model miss-especification and permit serialization of the error data to facilitate front-end debug.

Quick start

  1. Add “pumpwood_viewutils” to your Django INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'pumpwood_viewutils',
    ]
    

Description

Each model exposed by a PumpWood View have nine basic end-poitns exposed througth PumpWood router.

  • list, served as POST: {slugfied model_name}/list
  • list_without_pag, served as POST: {slugfied model_name}/list-without-pag
  • retrieve, served as POST: {slugfied model_name}/retrieve/(?pk)
  • delete, served as DELETE: {slugfied model_name}/retrieve/(?pk)
  • save, served as POST, PUT: {slugfied model_name}/save/
  • list_actions, served as GET {slugfied model_name}/actions/
  • execute_action, served as POST {slugfied model_name}/execute_action/(?pk)
  • list_search_options, served as GET {slugfied model_name}/options
  • list_options, served as POST {slugfied model_name}/options

list

Returns a list of objects acording with the filter dict passed as msg body. List is retricted with the maximum length defined on REST_FRAMEWORK[[‘PAGINATE_BY’]]

list-without-pag

Returns a list of objects acording with the filter dict passed as msg body, but without length limit

retrieve

Returns the object as a dictionary, serialized by retrive_serializer. Usualy, when an object is retrieved it have more information than when it is listed.

delete

Delete de object. For security reason, the url is maped but the code for deleting the object is not implemented (it raises an error, must be overrided).

save

Save and updates an object acording to msg body dictionary. If msg body have a pk the object with this pk will be updated, other wise it will be created

list_actions

List Class functions that have been marked with @rest_function wrapper. Returns a list with the path of the action, a short description, an indication for an icon to be used in the front end and necessary parameter, optional parameter and what the function will return.

execute_action

Execute an action over an object, if pk was filled, or a class method. Returns a dictionary with the results, the action name, parameters used in the action and the object on which the action was performed.

list_search_options

Return options to be user in dropdowns and other filter to be used in the search of the object.

list_options

List the options on the object creation according to parcial filment of the object.

This project is on beta phase, use it with carefull.

Release History

Release History

This version
History Node

0.3.9.6

History Node

0.3.9.5

History Node

0.3.9.4

History Node

0.3.9.3

History Node

0.3.9.2

History Node

0.3.9.1

History Node

0.3.9.0

History Node

0.3.8.0

History Node

0.3.7.7

History Node

0.3.7.5

History Node

0.3.7.4

History Node

0.3.7.3

History Node

0.3.7.2

History Node

0.3.7.1

History Node

0.3.7

History Node

0.3.6

History Node

0.3.5

History Node

0.3.4

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3.0

History Node

0.2.1

History Node

0.2.0

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

History Node

0.0.8

History Node

0.0.7

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pumpwood-viewutils-0.3.9.6.tar.gz (234.3 kB) Copy SHA256 Checksum SHA256 Source Mar 2, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS 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