2008/11/4 David Symonds <[EMAIL PROTECTED]> > > On Tue, Nov 4, 2008 at 11:15 AM, Ian Bambury <[EMAIL PROTECTED]> wrote: > > Thanks David, > >> > >> > What if I wanted to pull out a list where the quantity was over 1000 > and > >> > print the product description and the customer name? > >> > >> You don't. App Engine isn't designed for grabbing a large amount of > >> data. Users of a web application are really not going to want 1000 > >> pieces of data in one go. > > > > I meant that the order quantity was over 1000, not the number of pieces > of > > data. I'd be quite happy with 25 returned matches > > 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? I imagine that lines = OrderLine.all().filter('quantity >', 1000) will return me OrderLines so I now have a list of all the order lines in the system (or up to 1000 anyway) where the order quantity for that product is over 1000 units but I don't have the customer name or the product description which will differ for every line I had looked all through the Developer's Guide before I asked the question, and as I said, there are examples of adding your pet details to the DataStore (type="cat" name="Fluffy") but there aren't any examples for adding Country-Racecourse-Date-Race-Horse-Trainer-Owner-Jockey-Weight-Going-Odds-Report-Reporter or anything that even gives a simple example you can extrapolate from. > > > What if the user wants to see a list of all the movies which came out > last > > month which they *haven't* seen. Is there a way to do that? I can see > from > > your answer before that I can limit the list to ones which the user has > > added to their list of viewed films, but is it possible to get the > > complimentary data set? > > That's a fair bit harder to do in a single query. The simplest way for > a smallish number of movies would be to just fetch all the movies from > the last month, then fetch all the user's movies, and then compute the > set difference in Python. 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. So it seems that it might be scalable in the sense that everyone in the universe can look up the name of their cat at the same time, but it doesn't seem to scale well if your video rental shop has more than 1000 videos or your company has more than 1000 order lines, etc. It looks like GAE might not be capable of being a real-world business solution for anything with more than noddy requirements from what you say. 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. Or is there something big that I've not discovered yet? I hope there is. Ian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---