Dexter,

Take a look here: http://webpy.org/cookbook/sessions_with_subapp
This page shows how you can work with session and sub applications (more
than one file).


--
Tomás Schertel
----------------------------------------------
Linux Registered User #304838
Arch Linux User
http://www.archlinux-br.org/
----------------------------------------------


On Wed, Oct 26, 2011 at 10:30, Dexter <[email protected]> wrote:

> Hi
>
> I have started writing an application in web.py
> The main code.py page consists of numerous classes now and the
> different classes have content like forms to be rendered
>
> The page has become quite crowded. What is the best practice to
> organise webpy code. I thought that may putting the different classes
> in different files is a good idea. However that causes the DBSession
> stores and the commonly used decorators to be inaccessible to the
> classes.
>
> I can define the
> DBstore = web.session.DBStore(DB, 'sessions')
> dbsession = web.session.Session(app, DBstore, initializer={'count':
> 0})
>
> in a separate file and import it both in code.py and the other
> classes.py
>
> However I am not sure if then the same session remains globally used.
> How can I make some objects globally the same
> Should I use something like web.ctx
>
> One more question
> Can anyone explain what is the significance of
> render._keywords['globals']['render'] = render
> at
> http://webpy.org/skeleton/0.3
>
> in view.py
>
> --
> 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.
>
>

-- 
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.

Reply via email to