comparison roundup/hyperdb.py @ 128:ce36f2962b94

Fixed handling of passed-in values in form elements (ie. during a drill-down)
author Richard Jones <richard@users.sourceforge.net>
date Sun, 29 Jul 2001 08:27:40 +0000
parents 0791d13baea7
children 204f99944de0
comparison
equal deleted inserted replaced
127:0791d13baea7 128:ce36f2962b94
1 # $Id: hyperdb.py,v 1.7 2001-07-29 07:01:39 richard Exp $ 1 # $Id: hyperdb.py,v 1.8 2001-07-29 08:27:40 richard Exp $
2 2
3 # standard python modules 3 # standard python modules
4 import cPickle, re, string 4 import cPickle, re, string
5 5
6 # roundup modules 6 # roundup modules
385 385
386 def getkey(self): 386 def getkey(self):
387 """Return the name of the key property for this class or None.""" 387 """Return the name of the key property for this class or None."""
388 return self.key 388 return self.key
389 389
390 def labelprop(self, nodeid): 390 def labelprop(self):
391 ''' Return the property name for a label for the given node. 391 ''' Return the property name for a label for the given node.
392 392
393 This method attempts to generate a consistent label for the node. 393 This method attempts to generate a consistent label for the node.
394 It tries the following in order: 394 It tries the following in order:
395 1. key property 395 1. key property
549 raise ValueError, 'new property "%s": %s not a %s'%( 549 raise ValueError, 'new property "%s": %s not a %s'%(
550 k, entry, self.properties[k].classname) 550 k, entry, self.properties[k].classname)
551 u.append(entry) 551 u.append(entry)
552 l.append((1, k, u)) 552 l.append((1, k, u))
553 elif propclass.isStringType: 553 elif propclass.isStringType:
554 v = v[0]
555 if '*' in v or '?' in v: 554 if '*' in v or '?' in v:
556 # simple glob searching 555 # simple glob searching
557 v = v.replace('?', '.') 556 v = v.replace('?', '.')
558 v = v.replace('*', '.*?') 557 v = v.replace('*', '.*?')
559 v = re.compile(v) 558 v = re.compile(v)
787 cl.create(name=option[i], order=i) 786 cl.create(name=option[i], order=i)
788 return hyperdb.Link(name) 787 return hyperdb.Link(name)
789 788
790 # 789 #
791 # $Log: not supported by cvs2svn $ 790 # $Log: not supported by cvs2svn $
791 # Revision 1.7 2001/07/29 07:01:39 richard
792 # Added vim command to all source so that we don't get no steenkin' tabs :)
793 #
792 # Revision 1.6 2001/07/29 05:36:14 richard 794 # Revision 1.6 2001/07/29 05:36:14 richard
793 # Cleanup of the link label generation. 795 # Cleanup of the link label generation.
794 # 796 #
795 # Revision 1.5 2001/07/29 04:05:37 richard 797 # Revision 1.5 2001/07/29 04:05:37 richard
796 # Added the fabricated property "id". 798 # Added the fabricated property "id".

Roundup Issue Tracker: http://roundup-tracker.org/