Message from discussion
Many-to-many JOIN with the Datastore
MIME-Version: 1.0
Message-ID: <2d8dbdae-0039-4ddf-840d-3ce44c3527fd@l42g2000hsc.googlegroups.com>
Date: Thu, 8 May 2008 09:17:08 -0700 (PDT)
Received: by 10.150.50.2 with SMTP id x2mr69066ybx.25.1210263428452; Thu, 08
May 2008 09:17:08 -0700 (PDT)
In-Reply-To: <18e96914-1545-4905-9121-4dcdd25333dd@a9g2000prl.googlegroups.com>
X-IP: 66.193.42.195
References: <b0ae1a2a-08c6-436e-8969-161be80de6e8@27g2000hsf.googlegroups.com>
<45fc663c0804290850u63b0c363v5b1b6ec8e3fb0ac9@mail.gmail.com>
<e1843107-81c2-4f33-888e-25da02576e2c@a70g2000hsh.googlegroups.com>
<b7a6f0ad-24af-4840-888a-387d2422eb32@f63g2000hsf.googlegroups.com>
<8aa776e8-fd44-42ee-8c10-d55693d6cdc6@b64g2000hsa.googlegroups.com>
<5624dd1c-f1d2-4b29-b6e3-4a6de11777ad@b1g2000hsg.googlegroups.com>
<34036eb9-a05c-4aee-9ce1-646c2a473f2d@k37g2000hsf.googlegroups.com>
<6a82142e0804301736k4c1a3d2fr69a5aadd04a542c1@mail.gmail.com>
<18e96914-1545-4905-9121-4dcdd25333dd@a9g2000prl.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14)
Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe)
Subject: Re: Many-to-many JOIN with the Datastore
From: "arbinger...@gmail.com" <arbinger...@gmail.com>
To: Google App Engine <google-appengine@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
On May 3, 2:27 pm, cyj <chenyue...@gmail.com> wrote:
> Hi, I am a newbie to both GAE and python.
> I have a question about how to query the m:n model simulated by GAE?
> e.g. get a library has book1.
That's described in this post:
http://blog.arbingersys.com/2008/04/google-app-engine-better-many-to-many.html
Specifically, I pass
'libs_by_book': book1.libraries(),
to the template, which in turn does:
<h4>All libraries with book "{{ forbook }}"</h4>
<table border="1">
{% for lib in libs_by_book %}
<tr>
<td>{{ lib.name }}</td>
<td>{{ lib.address }}</td>
<td>{{ lib.city }}</td>
</tr>
{% endfor %}