On Tue, Nov 4, 2008 at 1:52 PM, Ian Bambury <[EMAIL PROTECTED]> wrote:
>> Oh, that's easy then. Just add a .filter('quantity >', 1000) to what I
>> wrote previously.
>
> But where would I pick up the customer name and product description?
You talked about "current customer" and "a particular product"; it's
up to you where those values come from.
If you don't want to filter that way, but want the data for *all*
customers, just get rid of the .filter('customer =', theCustomer) bit.
You can then access the customer object through the OrderLine's
customer property.
> Mmm. I dare say that would work for most situations, but it's not what you'd
> call a neat solution, it's brute force, and it relies on the number of
> matches being less than 1000 or the results will be incomplete. If you
> wanted to find out how many DVDs were never rented from a video rental
> service over the last year, you'd have more than 1000 titles and even if you
> didn't, you'd have to try to match them all up with all the rentals one at a
> time.
If that's a common operation, you'd keep a running tally on the DVD
record that gets incremented every time someone borrows it, and then
filter on that property.
There's usually ways to do these kind of filterings; you just have to
think creatively sometimes. SQL hides the horrible inefficiency of the
JOIN operator, so switching to App Engine requires you to think
through how exactly these things have to happen.
> In SQL you could do the whole thing, 10,000,000 records in one hit. It might
> take a moment or two, though, but it would do it.
There's stuff coming down the pipeline (search around this list for
the roadmap) that should help with those kind of things. But really,
App Engine is primarily (at least at the moment) about scalable web
applications, and scalable web applications almost never have a need
for serving 10,000,000 records on one request.
Dave.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---