Admin extension that automtically creates CRUD interfaces for all database models (or a selected list of models)
Enables automatic Admin interface generation from database models. The pyck.ext.admin_controller.AdminController allows you to quickly enable Admin interface for any number of database models you like. To use AdminController at minimum these steps must be followed.
1. In your application’s routes settings, specify the url where the CRUD interface should be displayed. You can use the pyck.ext.admin_controller.add_admin_handler() function for it. For example in your __init__.py; put code like:
from pyck.ext import AdminController, add_admin_handler
from pyck.lib import get_models
import my_application_package_name_here
# Place this with the config.add_route calls
add_admin_handler(config, DBSession, get_models(my_application_package_name_here), 'admin', '/admin',
AdminController)
and that’s all you need to do to get a fully operation Admin interface.
Configuration Options
These parameters are to be set as class properties in a sub-class of AdminController
TODO
A utility function to quickly add all admin related routes and set them to the admin handler class with one function call, for example:
from pyck.ext import add_admin_handler, AdminController
from pyck.lib import get_models
import my_application_package_name_here
# Place this with the config.add_route calls
add_admin_handler(config, DBSession, get_models(my_application_package_name_here), 'admin', '/admin',
AdminController)
| Parameters: |
|
|---|