[Zope] Getting title attribute given objectid

Peter Millar peter.millar at parasyn.com.au
Tue Dec 14 20:00:39 EST 2004


I am no expert but three ideas come immediately to mind.
You need to get the object the id refers to before you can request its
title.  
1.  I am pretty sure I have seen a method called something like an
abbreviation for get object by id
2.  use the portal_catalog
3.  search the source code for title, and see what other things do with
it or how they get it.

____________________________________________ 
Peter Millar 

-----Original Message-----
From: zope-bounces at zope.org [mailto:zope-bounces at zope.org] On Behalf Of
Cliff Fogle
Sent: Wednesday, 15 December 2004 10:54
To: zope at zope.org
Subject: [Zope] Getting title attribute given objectid


First off...I just started playing with Zope today...

This seems like it should be easy, but I've been searching google and
the archives all day to no avail.  I have an object ID and would like to
display the object title as the content of a drop down menu.  As it is
now I can only display the ID:

</select>
<select name="querytype">
<span tal:define="ids root/Database/querytype/objectIds" tal:repeat="id
ids" tal:omit-tag="">
<option tal:attributes="value id" tal:content="id">Item from sql
method</option>
</span>
</select>

What I want though is for the only the value to be the ID and the
content to be the title.  So something like this (which does not work):

</select>
<select name="querytype">
<span tal:define="ids root/Database/querytype/objectIds" tal:repeat="id
ids" tal:omit-tag="">
<option tal:attributes="value id" tal:content="id/title">Item from sql
method</option>
</span>
</select>

I'm going to go get a good book on Zope and read it tonight.  But if
that doesn't help can anyone here help me out?  Thanks

Cliff Fogle
Network Engineer
Ofoto, Inc.



More information about the Zope mailing list