i don't think you can do what you want.
in gql condition, you only have access to
__key__, which i bet is some hash of
kind + keyname + ...
so, keys_only query, then scan results.
or add another string prop and then
use some trick like
q.filter('key_s >=', u'_block\u0000')
q.filter('key_s <=', u'_block\u9999)
m
On Tue, Aug 30, 2011 at 4:39 PM, S.Prymak <[email protected]> wrote:
> Here is why comparing key does not work:
>
> import models
>
> pk=models.Page(key_name='_blocks')
>
> q=models.Page.gql("WHERE __key__ >= :1", pk.key())
>
> [p.key().name() for p in q]
>
> [u'_blocks--callout', u'_blocks--callout-contact', u'_blocks--footer-center',
> u'_blocks--teaser', u'_slides--home--1', u'about', u'collections',
> u'default', u'faq', u'shipping']
>
>
>
> In my implementation key name is a "slug" for page. I want only those pages
> wich slug begins with '_blocks'. Is it possible quering by key name?
>
> I thought about [p for p in models.Page.all() if p.key().name() >=
> '_blocks'], but I doubt it has good perfomance on large set of entities.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/Z8h6AQSoQw4J.
>
> 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/google-appengine?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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/google-appengine?hl=en.