Skip to main content

django-cruds is simple drop-in django app that creates CRUD for faster prototyping.

Project description

https://travis-ci.org/bmihelac/django-cruds.png?branch=master https://coveralls.io/repos/bmihelac/django-cruds/badge.png?branch=master https://pypip.in/v/django-cruds/badge.png

django-cruds is simple drop-in django app that creates CRUD (Create, read, update and delete) views for existing models and apps.

django-cruds goal is to make prototyping faster.

Documentation

To add CRUD for whole app, add this to urls.py:

from cruds.urls import crud_for_app
urlpatterns += crud_for_app('testapp')

This will create following urls and appropriate views (assuming there is a application named testapp with model Author:

URL

name

/testapp/author/

testapp_author_list

/testapp/author/new/

testapp_author_create

/testapp/author/(?P<pk>d+)/

testapp_author_detail

/testapp/author/(?P<pk>d+)/edit/

testapp_author_update

/testapp/author/(?P<pk>d+)/remove/

testapp_author_delete

It is also possible to add CRUD for one model:

from django.db.models.loading import get_model
from cruds.urls import crud_for_model
urlpatterns += crud_for_model(get_model('testapp', 'Author'))

crud_fields templatetag displays fields for an object:

{% load crud_tags %}

<table class="table">
  <tbody>
    {% crud_fields object "name, description" %}
  </tbody>
</table>

Quickstart

Install django-cruds:

pip install django-cruds

Then use it in a project, add cruds to INSTALLED_APPS.

Requirements

  • Python 2.7+ or Python 3.3+

  • Django 1.4.2+

History

0.1.2 (2014-06-10)

  • FIX: action url patterns should be in format /appname/model/3/edit/ and not /appname/model/edit/3/

  • add crud_fields templatetag

0.1.1 (2014-06-09)

  • Handle and FK returns link to detail view if exists.

  • fixes and tweaks

0.1.0 (2014-06-08)

  • First release on PyPI.

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-cruds-0.1.2.zip (16.1 kB view hashes)

Uploaded Source

Supported by

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