You could create your data model once, and then attach it to the registry. Then 
add a request method that fetches the result from the registry.

Bert

> On Apr 28, 2016, at 03:24, 'golauty' via pylons-discuss 
> <[email protected]> wrote:
> 
> Hi Guys,
> 
> i want to add a Data Model to my pyramid Web Application. Currently i create 
> the Data Model everytime when a view is accessed. 
> This does not work in my Application due performance problems. I want to have 
> a Data Model that is always accessable, for all views i have.
> Now i wonder what the best way is to transport my data model to the view. I 
> researched that i can use the 
> config.add_request_method to add a Property or a callable. But as i 
> understand the request Object creates the new Property/Callable everytime it 
> is accessed.
> That would be the same thing i already have. I just want to create the Data 
> Model at the startup and then use it for all my Views.
> So any suggestions what i can use? 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pylons-discuss/1b29789e-f83f-448b-8054-17bb873120e3%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/1DB4F5F9-41A1-470C-AA68-261642C603F6%400x58.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to