1616# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818#
19- # $Id: roundup-admin,v 1.28 2001-10-13 00:07:39 richard Exp $
19+ # $Id: roundup-admin,v 1.29 2001-10-16 03:48:01 richard Exp $
2020
2121import sys
2222if int (sys .version [0 ]) < 2 :
@@ -233,9 +233,9 @@ def do_set(db, args, comma_sep=0):
233233
234234def do_find (db , args , comma_sep = 0 ):
235235 '''Usage: find classname propname=value ...
236- Find the nodes of the given class with a given property value.
236+ Find the nodes of the given class with a given link property value.
237237
238- Find the nodes of the given class with a given property value. The
238+ Find the nodes of the given class with a given link property value. The
239239 value may be either the nodeid of the linked node, or its key value.
240240 '''
241241 classname = args [0 ]
@@ -245,8 +245,12 @@ def do_find(db, args, comma_sep=0):
245245 propname , value = args [1 ].split ('=' )
246246 num_re = re .compile ('^\d+$' )
247247 if not num_re .match (value ):
248- propcl = cl .properties [propname ].classname
249- propcl = db .getclass (propcl )
248+ propcl = cl .properties [propname ]
249+ if (not isinstance (propcl , hyperdb .Link ) and not
250+ isinstance (type , hyperdb .Multilink )):
251+ print 'You may only "find" link properties'
252+ return 1
253+ propcl = db .getclass (propcl .classname )
250254 value = propcl .lookup (value )
251255
252256 # now do the find
@@ -597,6 +601,9 @@ if __name__ == '__main__':
597601
598602#
599603# $Log: not supported by cvs2svn $
604+ # Revision 1.28 2001/10/13 00:07:39 richard
605+ # More help in admin tool.
606+ #
600607# Revision 1.27 2001/10/11 23:43:04 richard
601608# Implemented the comma-separated printing option in the admin tool.
602609# Fixed a typo (more of a vim-o actually :) in mailgw.
0 commit comments