Genrate CRUD interface in TurboGears
Project description
tgcrud is a ‘no magic’ crud interface generator, and the generated codes are fully customizable. It heavily use form widgets and show you many TG 1.0 existed features in it’s controllers/templates.
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.
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.