Re: Limited traversal

2012-02-19 Thread Andrey Popp
On Sun, Feb 19, 2012 at 12:44:24AM -0600, Michael Merickel wrote: On Sat, Feb 18, 2012 at 3:53 PM, Andrey Popp 8may...@gmail.com wrote: My use-case is different -- to allow User object to be attached on request without touching database (user id is encoded in authc cookie), but I think it

Re: Limited traversal

2012-02-19 Thread Fabio Dive
Great Job Michael, this simplify a lot the concept and the design I use with my applications with user data. Do you think I can write a class to retrieve data from the beaker session if it is loaded instead of dbconn? In case of None I can proceed with dbconn..is this the best approach to

Re: Limited traversal

2012-02-19 Thread Michael Merickel
On Sun, Feb 19, 2012 at 3:20 AM, Andrey Popp 8may...@gmail.com wrote: Yeah, thank you, that would work too, but already has custom Query class with othe goodies and also want to access user's id as request.user.id. That's fine of course. request.user.id works with this pattern though, just

Re: Limited traversal

2012-02-19 Thread Andrey Popp
On Sun, Feb 19, 2012 at 12:09:19PM -0600, Michael Merickel wrote: On Sun, Feb 19, 2012 at 3:20 AM, Andrey Popp wrote: Yeah, thank you, that would work too, but already has custom Query class with othe goodies and also want to access user's id as request.user.id. That's fine of course.

Re: Limited traversal

2012-02-19 Thread Mike Orr
On Sat, Feb 18, 2012 at 10:44 PM, Michael Merickel mmeri...@gmail.com wrote: On Sat, Feb 18, 2012 at 3:53 PM, Andrey Popp 8may...@gmail.com wrote: My use-case is different -- to allow User object to be attached on request without touching database (user id is encoded in authc cookie), but I

Re: Limited traversal

2012-02-19 Thread Chris McDonough
On Sun, 2012-02-19 at 11:13 -0800, Mike Orr wrote: On Sat, Feb 18, 2012 at 10:44 PM, Michael Merickel mmeri...@gmail.com wrote: On Sat, Feb 18, 2012 at 3:53 PM, Andrey Popp 8may...@gmail.com wrote: My use-case is different -- to allow User object to be attached on request without

Re: Limited traversal

2012-02-19 Thread Mike Orr
On Sun, Feb 19, 2012 at 11:21 AM, Chris McDonough chr...@plope.com wrote: On Sun, 2012-02-19 at 11:13 -0800, Mike Orr wrote: On Sat, Feb 18, 2012 at 10:44 PM, Michael Merickel mmeri...@gmail.com wrote: On Sat, Feb 18, 2012 at 3:53 PM, Andrey Popp 8may...@gmail.com wrote: My use-case is

Re: Limited traversal

2012-02-18 Thread Andrey Popp
On Fri, Feb 17, 2012 at 01:42:04AM +0400, Andrey Popp wrote: On Thu, Feb 16, 2012 at 12:09:36PM -0800, Mike Orr wrote: Second, how can I generate URLs to resources without loading the objects through this interface? The home page queries the 30 most recent incidents and displays links to

Re: Limited traversal

2012-02-18 Thread Michael Merickel
On Sat, Feb 18, 2012 at 3:53 PM, Andrey Popp 8may...@gmail.com wrote: My use-case is different -- to allow User object to be attached on request without touching database (user id is encoded in authc cookie), but I think it should work for constructing lazy resource graph as well. In

Re: Limited traversal

2012-02-17 Thread Mike Orr
On Thu, Feb 16, 2012 at 8:25 PM, Chris McDonough chr...@plope.com wrote: On Thu, 2012-02-16 at 20:22 -0800, Mike Orr wrote: On Thu, Feb 16, 2012 at 7:35 PM, Chris McDonough chr...@plope.com wrote: On Thu, 2012-02-16 at 19:13 -0800, Mike Orr wrote: On Thu, Feb 16, 2012 at 1:42 PM, Andrey Popp

Re: Limited traversal

2012-02-17 Thread Daniel Holth
You could use static routes to generate your URLs. These are routes that do not match at request time and are only used for URL generation. http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/urldispatch.html#static-route-narr -- You received this message because you are subscribed

Re: Limited traversal

2012-02-17 Thread Mike Orr
On Fri, Feb 17, 2012 at 11:42 AM, Daniel Holth dho...@gmail.com wrote: You could use static routes to generate your URLs. These are routes that do not match at request time and are only used for URL generation.

Limited traversal

2012-02-16 Thread Mike Orr
I'm weighing whether to use traversal in a limited way, and whether the benefits would outweigh the costs. I'm converting a Pylons application that has two database-related routes for read-only access: /incidents/{id} = Incident ORM class /entries/{id} = Entry ORM class I can use URL dispatch

Re: Limited traversal

2012-02-16 Thread Andrey Popp
On Thu, Feb 16, 2012 at 12:09:36PM -0800, Mike Orr wrote: I'm weighing whether to use traversal in a limited way, and whether the benefits would outweigh the costs. I'm converting a Pylons application that has two database-related routes for read-only access: /incidents/{id} = Incident

Re: Limited traversal

2012-02-16 Thread Andrey Popp
On Thu, Feb 16, 2012 at 12:09:36PM -0800, Mike Orr wrote: I'm weighing whether to use traversal in a limited way, and whether the benefits would outweigh the costs. I'm converting a Pylons application that has two database-related routes for read-only access: /incidents/{id} = Incident ORM

Re: Limited traversal

2012-02-16 Thread Andrey Popp
Oops, sorry for spamming list... -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com. To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com.

Re: Limited traversal

2012-02-16 Thread Mike Orr
On Thu, Feb 16, 2012 at 1:42 PM, Andrey Popp 8may...@gmail.com wrote: And that raises another issue, the incident resource doesn't really exist. I.e., /incident should return an error, not connect to a regular view or default view. How do I do that? Or how do I make the default view be not

Re: Limited traversal

2012-02-16 Thread Chris McDonough
On Thu, 2012-02-16 at 19:13 -0800, Mike Orr wrote: On Thu, Feb 16, 2012 at 1:42 PM, Andrey Popp 8may...@gmail.com wrote: And that raises another issue, the incident resource doesn't really exist. I.e., /incident should return an error, not connect to a regular view or default view. How do I

Re: Limited traversal

2012-02-16 Thread Mike Orr
On Thu, Feb 16, 2012 at 7:35 PM, Chris McDonough chr...@plope.com wrote: On Thu, 2012-02-16 at 19:13 -0800, Mike Orr wrote: On Thu, Feb 16, 2012 at 1:42 PM, Andrey Popp 8may...@gmail.com wrote: And that raises another issue, the incident resource doesn't really exist. I.e., /incident should

Re: Limited traversal

2012-02-16 Thread Chris McDonough
On Thu, 2012-02-16 at 20:22 -0800, Mike Orr wrote: On Thu, Feb 16, 2012 at 7:35 PM, Chris McDonough chr...@plope.com wrote: On Thu, 2012-02-16 at 19:13 -0800, Mike Orr wrote: On Thu, Feb 16, 2012 at 1:42 PM, Andrey Popp 8may...@gmail.com wrote: And that raises another issue, the incident