Uhm,
DBSession is a global object that proxies thread specific objects, so
it should be possible to use the model.DBSession from wherever you
want.

2012/3/6 Juan Antonio Ibáñez <[email protected]>:
> I would like to have a object having some methos in order to do some
> operations but not to have to pass DBSession as parameter in each
> request.
>
> On 29 feb, 05:37, Michael Pedersen <[email protected]> wrote:
>> I don't think you can do what you're looking to do in this fashion.
>> DBSession is, actually, per request. What are you looking to do
>> specifically, and maybe we can provide some better guidance from there?
>>
>> 2012/2/24 Juan Antonio Ibáñez <[email protected]>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> > Hello,
>>
>> >   I want to create one DB Manager object in order to do some
>> > operations through that object. That object should receive one
>> > DBSession referente on init but I would like to do at app init not
>> > inside each controller method. Is there any way to create this DB
>> > Manager to be available to all controller methods. I would like to
>> > init out of app_globals if possible.
>>
>> > Regards
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups
>> > "TurboGears" 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/turbogears?hl=en.
>>
>> --
>> Michael J. Pedersen
>> My Online Resume:http://www.icelus.org/-- Google+http://plus.ly/pedersen
>> Google Talk: [email protected] -- Twitter: pedersentg
>
> --
> You received this message because you are subscribed to the Google Groups 
> "TurboGears" 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/turbogears?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en.

Reply via email to