El mié, 30-09-2009 a las 06:04 -0700, ahappydeath escribió:
> Some of my classes are getting quite large, especially when I have
> multiple forms on a page. Is there a well know way of separating the
> classes from the code.py file.
in ur code.py:
urls = (
'/test', 'somefile.someclass'
)
in somefile, imports and some more crap.
I'm using this scheme, right now:
***
* code.py:
***
import web
from config import *
application = app.wsgifunc()
app.notfound = notfound
app.internalerror = internalerror
***
* config.py
***
import web
BASEDIR = '/var/www/intranet/'
render = web.template.render(BASEDIR+'tpl/', base="skin", cache=False)
db = web.database(...)
store = web.session.DBStore(db, 'sessions')
def notfound():
return web.notfound(render.notfound())
def internalerror():
return web.internalerror(render.internalerror())
def appError(msg=''):
return render.error(msg)
urls = (
'/test', 'somefile.someclass'
)
***
* In somefile.py:
***
import web
from config import *
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---