Thanks Ross, this is very helpful. :) Nick
On 8 February 2010 13:13, Ross M Karchner <[email protected]> wrote: > Poking around the code, and trial an error. > > For transactional tasks, just add transactional=True to any tasks you > create in a transaction-- if the transaction fails, the task won't be > created. > > For cursors, after doing a fetch() on a Query, .cursor() (on the Query > itself , not the results) will return a big ugly string that acts as the > cursor. > > Later (probably in a separate handler), use .with_cursor(the_cursor) to > modify the query. When you fetch, it will pick up where the previous fetch > left off. > > > Excerpted from my code: > > subscriber_q=Query(subscriptions.models.Subscription, > keys_only=True).filter('site =', edition.site).filter('newsletter =', > edition.newsletter).filter('active =', True) > if request.form.has_key('cursor'): > subscriber_q=subscriber_q.with_cursor(request.form['cursor']) > subscribers=subscriber_q.fetch(BATCH_SIZE) > > (it might look a little funny since I'm using YARO for my request object > http://lukearno.com/projects/yaro/ ) > > On Sun, Feb 7, 2010 at 8:51 PM, Nickolas Daskalou <[email protected]>wrote: > >> Where did you find the documentation for how to use these two new >> features? >> >> >> On 08/02/2010, at 12:45 PM, Ross M Karchner <[email protected]> >> wrote: >> >> I'm loving cursors and transactional tasks (which may be the geekiest >> sentence I've ever written)-- I hope send_mail is next to get transactional >> treatment. >> >> On Wed, Feb 3, 2010 at 5:03 PM, Ikai Lan < <[email protected]> >> [email protected]> wrote: >> >>> Hello App Engine Developers, >>> >>> As part of our ongoing efforts to improve release quality and >>> transparency, we will start prereleasing SDKs for early testing. We >>> hope this gives developers a chance to participate in our release >>> process by trying out new changes and sending feedback. As of this >>> morning, the prerelease SDK for our next release, 1.3.1, is available >>> in the familiar download location (note that the filename ends in >>> 'prerelease.zip'): >>> >>> <http://code.google.com/p/googleappengine/downloads/list> >>> http://code.google.com/p/googleappengine/downloads/list >>> >>> If you're interested, please download and give it a try locally with >>> your favorite App Engine code. Please note that, as a prerelease, this >>> SDK is not yet supported and still subject to change. Thus, please >>> don't take critical dependencies or make substantial changes to >>> production apps based on this SDK. >>> >>> Importantly, this prerelease is purely for the SDK and is intended for >>> local testing and development in dev_appserver. The server-side of App >>> Engine (our production environment) is not at 1.3.1, so deploying with >>> this SDK is not yet supported. In the future, we might enable a >>> complete SDK and server test environment for prereleases. >>> >>> Please try 1.3.1 for local development and send us your feedback! >>> >>> Thanks, >>> >>> App Engine Team >>> >>> >>> Python >>> ========= >>> - New support for Datastore Query Cursors >>> - New support for Transactional Task Creation >>> - Additional file extensions permitted when sending mail including .doc >>> and .xls >>> <http://code.google.com/p/googleappengine/issues/detail?id=494> >>> http://code.google.com/p/googleappengine/issues/detail?id=494 >>> - New Grab Tail added to Memcache API >>> - Support for Custom Admin Console pages >>> - New "month" and "synchronized" syntax for Cron configuration >>> - Application Stats library now included in with SDK >>> - Bulk Loader supports bulk downloading all kinds simultaneously >>> - appcfg.py validates SSL certificates for HTTPS connections >>> - Support for ETags, If-matches, If-not-matches HTTP Headers, as well as >>> 304 error codes now available on static files (not available on the >>> dev_appserver or Blobstore blobs) >>> <http://code.google.com/p/googleappengine/issues/detail?id=575> >>> http://code.google.com/p/googleappengine/issues/detail?id=575 >>> >>> Java >>> ========= >>> - Datastore Query Cursors >>> - Transactional Tasks >>> - Additional file extensions permitted when sending mail including .doc >>> and .xsl >>> <http://code.google.com/p/googleappengine/issues/detail?id=494> >>> http://code.google.com/p/googleappengine/issues/detail?id=494 >>> - Grab Tail added to Memcache API >>> - Support for Custom Admin Console pages >>> - Java Precompilation is now on by default. >>> - Developers can opt-out of precompilation by setting the flag in >>> appengine-web.xml >>> <precompilation-enabled>false</precompilation-enabled> >>> - New built-in support for unit testing (see appengine-testing.jar) >>> <http://code.google.com/p/googleappengine/issues/detail?id=326> >>> http://code.google.com/p/googleappengine/issues/detail?id=326 >>> - net.sf.jsr107 package included as an alternative to the low-level >>> Memcache API >>> - javax.annotation.Resource/Resources added to the package whitelist >>> - New "month" and "synchronized" syntax for Cron configuration >>> - URLFetch supports asynchronous requests >>> - <http://code.google.com/p/googleappengine/issues/detail?id=1899> >>> http://code.google.com/p/googleappengine/issues/detail?id=1899 >>> - appcfg.sh uses HTTPS for application deployment >>> - appcfg.sh adds request_logs --append >>> - Changes to the order queries without a specified sort order are >>> returned. Only queries that use IN will see different results. >>> - Added support for multiple != filters on the same property >>> - Improved support for keys-only queries when using IN and != filters >>> - Support for ETags, If-matches, If-not-matches HTTP Headers, as well as >>> 304 error codes now available on static files (not available on the >>> dev_appserver or Blobstore blobs) >>> <http://code.google.com/p/googleappengine/issues/detail?id=575> >>> http://code.google.com/p/googleappengine/issues/detail?id=575 >>> - Fixed issue where the maximum transform count was enforced for >>> composite operations >>> <http://code.google.com/p/googleappengine/issues/detail?id=1656> >>> http://code.google.com/p/googleappengine/issues/detail?id=1656 >>> - Fixed issue with whitespace on the end of strings in web.xml >>> <http://code.google.com/p/googleappengine/issues/detail?id=2242> >>> http://code.google.com/p/googleappengine/issues/detail?id=2242 >>> - Fixed "Not Found" issue when defining <error-page> in web.xml >>> <http://code.google.com/p/googleappengine/issues/detail?id=1477> >>> http://code.google.com/p/googleappengine/issues/detail?id=1477 >>> - Fixed issue when defining <welcome-file-list> in web.xml >>> <http://code.google.com/p/googleappengine/issues/detail?id=1249> >>> http://code.google.com/p/googleappengine/issues/detail?id=1249 >>> - Fixed issue where cancelling a deployment in progress would >>> unintentionally delete packages >>> <http://code.google.com/p/googleappengine/issues/detail?id=2255> >>> http://code.google.com/p/googleappengine/issues/detail?id=2255 >>> - Fixed issue with QuotaService.getCpuTimeInMegaCycles() returning 0 >>> <http://code.google.com/p/googleappengine/issues/detail?id=2639> >>> http://code.google.com/p/googleappengine/issues/detail?id=2639 >>> - Fixed issue where JSP exceptions will be incorrectly cast causing a >>> ClassCastException >>> <http://code.google.com/p/googleappengine/issues/detail?id=1438> >>> http://code.google.com/p/googleappengine/issues/detail?id=1438 >>> >>> -- >>> Ikai Lan >>> Developer Programs Engineer, Google App Engine >>> <http://googleappengine.blogspot.com> >>> http://googleappengine.blogspot.com | <http://twitter.com/app_engine> >>> http://twitter.com/app_engine >>> >>> -- >>> 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]> >>> [email protected]. >>> To unsubscribe from this group, send email to >>> <google-appengine%[email protected]> >>> [email protected]. >>> For more options, visit this group at >>> <http://groups.google.com/group/google-appengine?hl=en> >>> 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. >> >> -- >> 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]<google-appengine%[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]<google-appengine%[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.
