|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -# $Id: htmltemplate.py,v 1.92 2002-06-11 04:57:04 richard Exp $ |
| 18 | +# $Id: htmltemplate.py,v 1.92.2.1 2002-07-10 07:21:18 richard Exp $ |
19 | 19 |
|
20 | 20 | __doc__ = """ |
21 | 21 | Template engine. |
@@ -146,10 +146,18 @@ def determine_value(self, property): |
146 | 146 | return [] |
147 | 147 | return value |
148 | 148 | elif self.filterspec is not None: |
| 149 | + print self.filterspec |
149 | 150 | if isinstance(propclass, hyperdb.Multilink): |
150 | 151 | return self.filterspec.get(property, []) |
151 | 152 | else: |
152 | | - return self.filterspec.get(property, '') |
| 153 | + if not self.filterspec.has_key(property): |
| 154 | + return '' |
| 155 | + value = self.filterspec[property] |
| 156 | + if hasattr(value, 'value'): |
| 157 | + value = value.value |
| 158 | + if isinstance(value, type([])): |
| 159 | + value = value[0] |
| 160 | + return value |
153 | 161 | # TODO: pull the value from the form |
154 | 162 | if isinstance(propclass, hyperdb.Multilink): |
155 | 163 | return [] |
@@ -1191,6 +1199,9 @@ def render(self, form): |
1191 | 1199 |
|
1192 | 1200 | # |
1193 | 1201 | # $Log: not supported by cvs2svn $ |
| 1202 | +# Revision 1.92 2002/06/11 04:57:04 richard |
| 1203 | +# Added optional additional property to display in a Multilink form menu. |
| 1204 | +# |
1194 | 1205 | # Revision 1.91 2002/05/31 00:08:02 richard |
1195 | 1206 | # can now just display a link/multilink id - useful for stylesheet stuff |
1196 | 1207 | # |
|
0 commit comments