An Ajax CRUD system for Django models based on Knockout and JQuery UI
- Jquery 1.10.1
- Jquery-tmpl 1.0.0pre
- Jquery-ui 1.10.1
- Knockout 2.2.1
required files from chucho that must be loaded are the following:
While it is not strictly necessary it is recommended that you also use the Twitter Bootstrap css found at:
NOTE: There is a specific order which should be obeyed when importing the needed js files.
Install Chucho into your project as a git submodule.
git submodule add git://github.com/visgence/django-chucho.git /chucho
Configure settings file to use with Chucho.
Add the following to settings.
D_FORMAT = "%m/%d/%Y" def GET_PERMISSION_OBJ(): ''' ' This function should be modified to return the object that is used to verify permissions in the ' object managers. This is required for the chucho interface. ''' from django.contrib.auth import get_user_model return get_user_model() ... INSTALLED_APPS = ( ... 'chucho', ... ) ...
- Add Chucho url to root urls.py
Add this url to your url patterns inside the root url.py of your project
- Import ChuchoManager and ChuchoUserManager
For the models that you wish to manage using Chucho, we have provided a default base manager class for your convenience. You can import ChuchoManger from chucho.models and either make it the manager of any of your models or if you already have a manager for your model that you've written yourself just make sure it inherits from ChuchoManger.
The ChuchoManager class provides default implementations of the manager methods necessary for Chucho's permission checking and filtering. To implement your own custom permissions or filters, you may overwrite any of the provided manager methods. Please see Overriding Managers section for details.
If you happen to have a User model that overrides Django's auth_user model then you can use Chucho with that model too. Just import ChuchoUserManager from chucho.models and follow the same instructions as before for the regular ChuchoManager.
To use chucho you first need to provide a hook by adding a div element with the id "chuchoGridContainer". Second you need to make a call to loadModelGrid() and pass it the django app your model resides in and the models name all lower case.
< Soon To Be Written>
Visgence, Inc. www.visgence.com
This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/us/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.