<p>Is there a way to get the key (or id) value of a db.ReferenceProperty, without dereferencing the actual entity it points to?  I have been digging around - it looks like the key is stored as the property name preceeded with an _, but I have been unable to get any code working.  Examples would be much appreciated.  Thanks.</p>

<p>EDIT:  Here is what I have unsuccessfully tried:</p>

<pre><code>class Comment(db.Model):
    series = db.ReferenceProperty(reference_class=Series);

    def series_id(self):
        return self._series
</code></pre>

<p>And in my template:</p>

<pre><code>&lt;a href="games/view-series.html?series={{comment.series_id}}#comm{{comment.key.id}}"&gt;more&lt;/a&gt;
</code></pre>

<p>The result:</p>

<pre><code>&lt;a href="games/view-series.html?series=#comm59"&gt;more&lt;/a&gt;
</code></pre>

You're correct - the key is stored as the property name prefixed with '_'. You should just be able to access it directly on the model object. Can you demonstrate what you're trying? I've used this technique in the past with no problems.
Edit: Have you tried calling series_id() directly, or referencing _series in your template directly? I'm not sure whether Django automatically calls methods with no arguments if you specify them in this context. You could also try putting the @property decorator on the method.