Help wanted

21 views
Skip to first unread message

Anton Danilchenko

unread,
Dec 28, 2010, 6:41:26 PM12/28/10
to gaefra...@googlegroups.com
We need your help in solve issue for work with @register.inclusion_tag

Anton Danilchenko

unread,
Dec 30, 2010, 5:48:58 AM12/30/10
to gaefra...@googlegroups.com
Today I have describe idea of how to solve problem with select data from datastore with more that one "not equal" property if used different properties.

For example, you can't do this in Datastore:
apartment = Apartment.all().filter("rooms>=", 2).filter("cost<", 50000)

Read detailed description in issue tracker: http://code.google.com/p/appengine-framework/issues/detail?id=34

Niklas Rosencrantz

unread,
Dec 30, 2010, 4:02:48 PM12/30/10
to gaefra...@googlegroups.com

Thank you Anton! My project needs something like that. /Niklas

Robert Kluin

unread,
Dec 30, 2010, 1:37:07 PM12/30/10
to gaefra...@googlegroups.com
GAE might introduce support for this when the next-gen queries stuff goes live.

I posted a response with some comments on the issue tracker.

Robert

Anton Danilchenko

unread,
Dec 31, 2010, 9:26:15 AM12/31/10
to gaefra...@googlegroups.com
Thanks Robert!

I will see this IO in the next year. Happy NEW year!!!

Niklas R

unread,
Jan 2, 2011, 1:43:36 AM1/2/11
to gaeframework, nikl...@gmail.com, hol...@gmail.com, alex.h...@gmail.com, kim...@gmail.com
I'd be glad to use only one query since I also have to order by time
and truncate the query to a given number of elements to output for a
web pagination.
I want to enable something like the following
apartment = Apartment.all().filter("modified <=",
bookmark ).filter("modified >", timeline).filter("rooms>=",
2).filter("cost<", 50000).order("-modified").fetch(PAGESIZE+1)
So making the filter operator more flexible I think is preferred in my
case rather than joining two queries and also better than trying to do
it with GQL IN / GQL NOT IN.
Regards,
Niklas

Robert Kluin

unread,
Jan 2, 2011, 1:18:52 PM1/2/11
to gaefra...@googlegroups.com
Niklas,
That is something that would be extremely difficult to do with one
query, given how indexes work. On the backend, your indexes look
something like this:

[your app id]|[namespace]|Apartment|rooms:[rooms value]|cost:[cost
value]|modified

That is why App Engine requires the values of rooms and cost to be
'fixed' (not a range). Those values are stored ordered so that
range-scans (ie inequality filters) can be run.

That's why binning the data like Anton was suggesting is a good
solution, when it is possible. Often times it is not possible or it
is impractical.

For some use cases it may be possible to construct your own 'index
entities' then join the results in memory to produce a result set. In
general, to do that efficiently, you need to know something about the
data or have small result sets.


Robert

Niklas R

unread,
Jan 2, 2011, 5:38:32 PM1/2/11
to gaeframework
Dear Robert and Anton,
Thanks a lot for the help! I want to page data sets about 50 items per
page ordered by DateTimeProperty desc or asc.
Joining two queries works that as far as I understand I don't have to
iterate and only sort it according to time and pick the 50 most
relevant (depending on viewing newest or oldest) and I also could use
index entities. Listing apartments this way is a feature craigslist
has
http://sfbay.craigslist.org/hhh/
It only has 1 range filter and categories for the number of rooms.
I want to implement a similar function when all my search does so far
is
category + location. For a first version I care more that it displays
the correct results and then we
can evaluate which solution to build on. My somewhat messy attempt to
query datastore
is pasted you're welcome to have a look at: http://pastebin.com/NVu31XGN
Thanks!
Niklas
On Jan 2, 6:18 pm, Robert Kluin <robert.kl...@gmail.com> wrote:
> Niklas,
>   That is something that would be extremely difficult to do with one
> query, given how indexes work.  On the backend, your indexes look
> something like this:
>
>   [your app id]|[namespace]|Apartment|rooms:[rooms value]|cost:[cost
> value]|modified
>
>   That is why App Engine requires the values of rooms and cost to be
> 'fixed' (not a range).  Those values are stored ordered so that
> range-scans (ie inequality filters) can be run.
>
>   That's why binning the data like Anton was suggesting is a good
> solution, when it is possible.  Often times it is not possible or it
> is impractical.
>
>   For some use cases it may be possible to construct your own 'index
> entities' then join the results in memory to produce a result set.  In
> general, to do that efficiently, you need to know something about the
> data or have small result sets.
>
> Robert
>

Anton Danilchenko

unread,
Jan 4, 2011, 1:55:13 PM1/4/11
to gaefra...@googlegroups.com
We have a problem with guestbook app.

We need render HTML form as Django form. We can do this only first time. On all next page reloads we have see error message. I think that we have stored data between pages reloads and this coerce problem.

We need you investigation and help ASAP. Thanks!

Anton Danilchenko

unread,
Jan 4, 2011, 2:09:45 PM1/4/11
to gaefra...@googlegroups.com
Thanks Niklas and Robert!

You think that ListProperty work very slow and not ready for a hight-load production environment? I understand, that ListProperty work slower than StringProperty or IntegerProperty. But I also think, that if I have 500 000 results - I can't join my results in memory by fetching data for the each record and do filtering.

records = []
for record in Apartment.all():  # do this 500000 times per request
  if record.cost >= 100000 and record.cost <=200000:
    records.append(record)

We are welcome your proposition. And crazy propositions also welcome! ;-)

We need complete this task and go ahead. Thanks!

Niklas R

unread,
Jan 15, 2011, 1:39:06 AM1/15/11
to gaeframework
I can use the guestbook app with no problem. I hope also to see a
solution to the query
Apartment.all().filter("rooms>=", 2).filter("cost<", 50000)
Regards,
Niklas
On Jan 4, 6:55 pm, Anton Danilchenko <anton.danilche...@gmail.com>
wrote:

Anton Danilchenko

unread,
Jan 17, 2011, 7:03:40 AM1/17/11
to gaefra...@googlegroups.com
Hello guys!

Now we have the main task - complete ADMIN application, for manage data for all applications into your project. Main goal - create very simple for use and powerful administration interface based on dynamic loading and inline data changes (based on AJAX with jQuery).

We invite all people to help us in this great work!

Anton Danilchenko

unread,
Feb 16, 2011, 4:46:34 PM2/16/11
to gaefra...@googlegroups.com
Cached templates on development server

We have a problem with template caching. We need your help to solve this problem. We have used latest development version in repository.
Reply all
Reply to author
Forward
0 new messages