This is very promising! Are you saying that this reference collection
query should work (note the named collection)?
class Foo(db.Model):
prop1 = db.IntegerProperty()
class Fee(db.Model):
my_foo = db.ReferenceProperty(Foo, collection_name='my_collection')
prop2 = db.IntegerProperty()
foos = Foo.all().filter('prop1 =', 32)
results = Fee.gql('WHERE prop2 = 18 AND collection_name IN :1', foos)
That would be awesome, and I'd just have to try a little harder to get
things to work. Of course in my real example, I'm using db.Searchable
instead of Model, and using search, but I'd be happy just to get the
above to work.
On Mar 4, 12:46 pm, ryan <[email protected]> wrote:
> On Mar 4, 9:11 am, Devel63 <[email protected]> wrote:
>
> > It is indeed a more complex query, and the IN values are keys. At one
> > point, I had tried to make them key values in a named reference
> > collection, but while the data store never complained, it never
> > returned any results.
>
> understood. happily, for the purposes of this conversation, the type
> of the IN values actually doesn't matter. IN won't generate an index
> per list length regardless of the IN values' type.
>
> > Can you confirm that it is impossible to make an entity query that
> > filters by normal prop vals and by a list of keys in a collection?
> > e.g. Entity.gql('WHERE prop1 = :val1 AND named_collection
> > IN :key_list', val1=val, key_list=keys)
>
> no, that's definitely possible. fromhttp://shell.appspot.com/:
>
> >>> class Foo(db.Expando):
> pass
> >>> Foo.gql('WHERE x = 0 AND y IN (1, 2)').fetch(3)
>
> [<__main__.Foo object at 0xf5ca9957dc3a9c30>, <__main__.Foo object at
> 0xf5ca9957dc3a9fb0>, <__main__.Foo object at 0xf5ca9957dc3a9cb0>]
>
> again, this is true regardless of the type of the filter values.
>
> > Separately, spurred on by your comments, I cleared the datastore and
> > started again. Now, the index explosion is not occurring. I guess
> > that some interim query experiment requested such indexes, and
> > stopping the datastore and deleting the indexes out of the index.yaml
> > file was not sufficient to clear them, so they kept reappearing in
> > index.yaml.
>
> hmm. the dev_appserver stores both the datastore and the query
> history, in separate files. i wonder if the query history file somehow
> didn't get deleted. (it defaults to /tmp/
> dev_appserver.datastore.history.) more in the docs:
>
> http://code.google.com/appengine/docs/python/tools/devserver.html#Com...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---