This file is for you to describe the PyCRUD application. Typically
you would include information such as the information below:

Installation and Setup
======================

Install ``PyCRUD`` using easy_install::

    easy_install PyCRUD

Make a config file as follows::

    paster make-config PyCRUD config.ini

Tweak the config file as appropriate and then setup the application::

    paster setup-app config.ini


Setup Libraries and Configuration
=================================


Change lib/app_globals.py -- it should only contain:
'''
from pylons import config
from pycrud.lib.app_globals import Globals
'''

Change lib/base.py -- this file should only contain:
'''
from pycrud.lib.base import *
import <project>.lib.helpers as h
import <project>.model as model

pycrud.lib.base.model = model
'''
Where <project> is your project.


Change lib/helpers.py -- it should only contain:
'''
from pycrud.lib.helpers import *
'''


Modify config/environment.py:
Add:
'''
from sqlalchemy import engine_from_config
import pycrud
pycrud_root = os.path.dirname(os.path.abspath(pycrud.__file__))
'''

Change:
templates=[os.path.join(root, 'templates')])
Into:
templates=[os.path.join(root, 'templates'), os.path.join(pycrud_root, 'templates')])


Append to load_environment:
'''
config['pylons.g'].sa_engine = engine_from_config(config, 'sqlalchemy.default.')
config['pylons.g'].base_url = config['base_url']
'''


Modify websetup.py:
import paste.deploy

After calling load_environment, add:
'''
paste.deploy.CONFIG.push_process_config({'app_conf':conf.local_conf,
                                         'global_conf':conf.global_conf})

from <project> import model
engine = config['pylons.g'].sa_engine
print 'Creating database tables'
model.meta.create_all(bind=engine)
'''
Where <project> is your project.


Modify ../development.ini -- in the app:main section, add these:
'''
sqlalchemy.default.url = <connection_string>
base_url =
'''



Copy Static Content
===================

Copy files using:
cp -a <python-site-packages>/PyCrud*/pycrud/public/* <proj-dir>/public/
This should work:
cp -a /usr/lib/python*/site-packages/PyCRUD*/pycrud/public/* ./public/


Then you are ready to go.



Creating your controller
========================

Run:
paster controller <controller_name>


Edit the controller you created:

Add:
from <project> import model

Change BaseController to ListController

Remove the index() method

Add a table attribute that refers to your table class
