Thanks for all the useful replies. I learned a lot in the last few
days. Some things that I ended up implementing:
1. a generic BlogFolder class for all my resources that return a list
of posts. I figured out that the context declaration for a view can be
an inherited class, which is great. All th
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 01/30/2011 01:21 PM, Mike Orr wrote:
> On Sun, Jan 30, 2011 at 8:25 AM, Wade Leftwich wrote:
>> Actually a bit more in keeping with the spirit of Traversal, and again
>> keeping your calls to Mongo to a mininum, would be something like
>> this:
>>
On Jan 30, 3:56 pm, oO wrote:
> Thanks for the info. I'm following up on the idea of using
> request.subpath, but at what point does this property get created?
> This is my understanding of the call stack:
>
> 1. the RootFactory is called, with the request object as a parameter
> 2. the RootFactor
Thanks for the info. I'm following up on the idea of using
request.subpath, but at what point does this property get created?
This is my understanding of the call stack:
1. the RootFactory is called, with the request object as a parameter
2. the RootFactory returns the root resource
3. Pyramid rec
On Jan 30, 1:21 pm, Mike Orr wrote:
> Are you traversing each level of the date here, or using a subpath from
> archive?
Traversing each level -- the same pattern Tres described this morning
as "transient" context classes.
>It seems like extra overhead to create a temporary Year class and
>Mon
On Sun, Jan 30, 2011 at 8:25 AM, Wade Leftwich wrote:
> Actually a bit more in keeping with the spirit of Traversal, and again
> keeping your calls to Mongo to a mininum, would be something like
> this:
>
> /blog/month/2011/01/29/my-post-about-pyramid would do this:
>
> archive = Blog['archive']
>
> This would handle shorter paths in a natural way -- e.g. '/blog/month/
> 2011/01' would map to the default view for Month(y=2011, m=1), which
> would call Post.list_posts_for_month() .
>
Er, make that "the default view for Month(y=2011, m=1), which would
call Month.list_posts_for_month() which w
Actually a bit more in keeping with the spirit of Traversal, and again
keeping your calls to Mongo to a mininum, would be something like
this:
/blog/month/2011/01/29/my-post-about-pyramid would do this:
archive = Blog['archive']
year = archive['2011'] = archive.__getitem__('2011') = Year(y=2011)
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 01/30/2011 09:04 AM, Wade Leftwich wrote:
> If you want to stick with Traversal, don't forget that you have
> request.subpath available to you. For the path "/blog/archive/
> 2011/01/29/my-post-about-pyramid", you could have an Archive context
> who
If you want to stick with Traversal, don't forget that you have
request.subpath available to you. For the path "/blog/archive/
2011/01/29/my-post-about-pyramid", you could have an Archive context
whose default (unnamed) view would be called with a request that
included request.subpath = ['2011', '
On 1/29/11 6:14 PM, oO wrote:
Sorry if this is a newbie question, but I'm finding that I'm a little
bit lost when it comes to the best way to implement an example
application using MongoDB (or any non-ZODB datastore) and traversal.
Conceptually, I like the idea of traversal instead of URL Dispat
Sorry if this is a newbie question, but I'm finding that I'm a little
bit lost when it comes to the best way to implement an example
application using MongoDB (or any non-ZODB datastore) and traversal.
Conceptually, I like the idea of traversal instead of URL Dispatch but
I find I'm a little bit l
12 matches
Mail list logo