Skip to content

sirpthatch/django-auto-crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

This is a simple django module which automatically exposes CRUD (created, read, update, delete) views for your django registered modules.  At the moment, here are the steps to use it:
* Include the project on your path
* In your root urls conf file, add a reference like the following:
url(r'^crud/', include(autocrud.urls))

At this point, when you run your server you should be able to make PUT requests to url's like:
http://somewebsite/crud/myapp/create/mymodel

In the PUT requests, you should place the parameters of your model classes.  For example, if I have the following model:

class TestModel(models.Model):
  number_field = models.IntegerField()

Then, a creation request would look like:
http://somewebsite/crud/myapp/create/testmodel PUT={"number_field":42}
(This returns the newly created object's id in the response)

A read request would look like:
http://somewebsite/crud/myapp/read/testmodel PUT={"id":1}

An update request would look like:
http://somewebsite/crud/myapp/update/testmodel PUT={"id":1, "number_field":43}

And finally, a delete request would look like:
http://somewebsite/crud/myapp/delete/testmodel PUT={"id":1}


Take a look at the test cases for examples of this in operation.

About

Module to auto-generate CRUD views for Django models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages