This is not the best way. It will run a separate query for each board id. 
On GAE you want to do
as much as you can in a single query. So the best way is to construct a 
list of GAE keys and
get all entities together. Unfortunately, AFAIK, there is no support for 
GAE batch queries in DAL.
You can, however, try to refer to the GAE datastore directly.

from google.appengine.ext import db as gdb

articles = db().select(db.articles.ALL)
keys = [gdb.Key.from_path("boards", a.board_id) for a in articles]
boards = gdb.get(keys)

But I'm afraid this is not an elegant solution as it probably won't work 
without a gdb.Model defined
for the board entity, and that would go against DRY [1]. Anyway, if you 
want to do it, see the GAE
docs [2] for details on model definition.

Depending on how often are you going to perform this query a better 
solution might be redesigning
your database. Forget about 3NF and add the board attributes to each 
article entity so that you
can fetch everything together in a single query.

[1] https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
[2] http://code.google.com/appengine/docs/python/datastore/entities.html

Reply via email to