Genrate CRUD interface in TurboGears
Project description
tgcrud is a ‘no magic’ crud (create, read, update, delete) interface generator, and the generated codes are fully customizable. tgcrud heavily use form widgets and show you many TG 1.0 features in it’s controllers/templates.
If you are a TG beginer, tgcrud help you create a general admin skeleton based on your model.
If you are an experienced TG developer, you could get it in minutes since it just done the basic procedure that every time you write a management interface of your model.
Install
The ‘tgcrud’ command extension is available in Python CheeseShop and TurboGears svn.
You can use setuptools to install tgcrud with following command:
$ easy_install tgcrud
or download the source code and install tgcrud manually.
Screencast
Yes, there’s a ‘Make a Book Site with TurboGears’ screencast with tgcrud.
If you are an experienced TG developer, you could watch the third one directly.
If you are new to TG, you may want to watch all of them in sequence.
Quickstart TurboGears project, 6.5MB
Design model with toolbox utilities, 7.7MB
tgcrud, the TG’s scaffold, 5.2 MB
With tgcrud you could easily generate a Rails scaffold style CRUD interface. The difference is all code in tgcrud is implicit, which leads a more easy customization.
Usage
Define your model in model.py
After you’ve defined your model, you could use “tg-admin crud” command to generate the crud pack. The syntax is:
$ tg-admin crud [model class name] [package name]
e.x if the model name is BookMark, the package name is BookMarkController, the command is:
$ tg-admin crud BookMark BookMarkController
Then the ‘admin’ package is generated. You just need take several minutes to customize the formfield to have a proper crud interface.
Import the package to your controllers.py with a line:
from BookMarkController import BookMarkController
and add a branch on your Root():
foo = BookMarkController()
Customize the form filed in admin/controllers.py
Open the http://localhost:8080/foo to use the customizable interface.
Please refer to http://docs.turbogears.org/1.0/CRUDTemplate for detail
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file tgcrud-0.9.zip
.
File metadata
- Download URL: tgcrud-0.9.zip
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d0a44c561bd2f09c55c94a644d559127b6303e2f683b7492f69c4b3b1d1a19f |
|
MD5 | 39c4d4bcafd091ae7383a55ca376cfd5 |
|
BLAKE2b-256 | bc6052008095f12969d71954669fcb2f29f7debd92a382fb39f76c917c398f3c |
File details
Details for the file tgcrud-0.9-py2.5.egg
.
File metadata
- Download URL: tgcrud-0.9-py2.5.egg
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e84a71c12a88bddd74e25ba0fef5a9d211f25945c0d8a2c7c2d6e4567714622e |
|
MD5 | 1b7e0ca93b4e7b1cb65634eee8773007 |
|
BLAKE2b-256 | 67e2692f5eae037a1070f688d871754f58c3890a3cea1175a7a2b0da96b39ff2 |
File details
Details for the file tgcrud-0.9-py2.4.egg
.
File metadata
- Download URL: tgcrud-0.9-py2.4.egg
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ba054747299bd5d6242c61695a10ad1d2d72de8af19142d31e3801a52a14a9c |
|
MD5 | 430f9e31e92e42a8872629ff07774531 |
|
BLAKE2b-256 | 1a1f8fe6d545018e014838a85f8d9340013f27546f924a2067d864262005b7ef |