1515# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717#
18- # $Id: htmltemplate.py,v 1.25 2001-10-09 07:25:59 richard Exp $
18+ # $Id: htmltemplate.py,v 1.26 2001-10-14 10:55:00 richard Exp $
1919
2020import os , re , StringIO , urllib , cgi , errno
2121
@@ -213,11 +213,11 @@ def __call__(self, property=None, **args):
213213 value = self .cl .get (self .nodeid , property )
214214 else :
215215 if isinstance (propclass , hyperdb .Multilink ): value = []
216+ elif isinstance (propclass , hyperdb .Link ): value = None
216217 else : value = ''
217218 if isinstance (propclass , hyperdb .Link ):
218219 linkname = propclass .classname
219- if value is None :
220- return '[not assigned]'
220+ if value is None : return '[no %s]' % property .capitalize ()
221221 linkcl = self .db .classes [linkname ]
222222 k = linkcl .labelprop ()
223223 linkvalue = linkcl .get (value , k )
@@ -226,11 +226,14 @@ def __call__(self, property=None, **args):
226226 linkname = propclass .classname
227227 linkcl = self .db .classes [linkname ]
228228 k = linkcl .labelprop ()
229+ if not value : return '[no %s]' % property .capitalize ()
229230 l = []
230231 for value in value :
231232 linkvalue = linkcl .get (value , k )
232233 l .append ('<a href="%s%s">%s</a>' % (linkname , value , linkvalue ))
233234 return ', ' .join (l )
235+ if isinstance (propclass , hyperdb .String ):
236+ if value == '' : value = '[no %s]' % property .capitalize ()
234237 return '<a href="%s%s">%s</a>' % (self .classname , self .nodeid , value )
235238
236239class Count (Base ):
@@ -753,6 +756,10 @@ def newitem(client, templates, db, classname, form, replace=re.compile(
753756
754757#
755758# $Log: not supported by cvs2svn $
759+ # Revision 1.25 2001/10/09 07:25:59 richard
760+ # Added the Password property type. See "pydoc roundup.password" for
761+ # implementation details. Have updated some of the documentation too.
762+ #
756763# Revision 1.24 2001/09/27 06:45:58 richard
757764# *gak* ... xmp is Old Skool apparently. Am using pre again by have the option
758765# on the plain() template function to escape the text for HTML.
0 commit comments