Skip to main content

alfred westerveld's Library tagged google   View Popular

Google App Engine Blog: 10 things you (probably) didn't know about App Engine

  • for entity in MyModel.all().filter("color =",
    old_favorite).fetch(100):
    entity.color = new_favorite
    entity.put()

    Doing the update this way requires one datastore round trip for the query, plus one additional round trip for each updated entity - for a total of up to 101 round trips! In comparison, take a look at this example:

    updated = []
    for entity in MyModel.all().filter("color =",
    old_favorite).fetch(100):
    entity.color = new_favorite
    updated.append(entity)
    db.put(updated)

21 Oct 09

App Engine Fan: Unit tests for Google App Engine apps

  • import unittest
    import sys
    import os.path


    # Change the following line to reflect wherever your
    # app engine installation and the mocker library are
    APPENGINE_PATH = '../google_appengine'
    MOCKER_PATH = '../mocker-0.10.1'


    # Add app-engine related libraries to your path
    paths = [
    APPENGINE_PATH,
    os.path.join(APPENGINE_PATH, 'lib', 'django'),
    os.path.join(APPENGINE_PATH, 'lib', 'webob'),
    os.path.join(APPENGINE_PATH, 'lib', 'yaml', 'lib'),
    MOCKER_PATH,
    ]
    for path in paths:
    if not os.path.exists(path):
    raise 'Path does not exist: %s' % path
    sys.path = paths + sys.path
    import mocker
1 - 20 of 157 Next › Last »
Showing 20 items per page

Diigo is about better ways to research, share and collaborate on information. Learn more »

Join Diigo