comparison roundup/hyperdb.py @ 312:5a2c43891c20

[SF#473124]: UI inconsistency with Link fields. This also prompted me to fix a fairly long-standing usability issue - that of being able to turn off certain filters.
author Richard Jones <richard@users.sourceforge.net>
date Sun, 21 Oct 2001 04:44:50 +0000
parents cb6d168b5aaa
children 62f899fb0c03
comparison
equal deleted inserted replaced
311:895a1c09f4ae 312:5a2c43891c20
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 # $Id: hyperdb.py,v 1.27 2001-10-20 23:44:27 richard Exp $ 18 # $Id: hyperdb.py,v 1.28 2001-10-21 04:44:50 richard Exp $
19 19
20 # standard python modules 20 # standard python modules
21 import cPickle, re, string 21 import cPickle, re, string
22 22
23 # roundup modules 23 # roundup modules
582 v = [v] 582 v = [v]
583 # replace key values with node ids 583 # replace key values with node ids
584 u = [] 584 u = []
585 link_class = self.db.classes[propclass.classname] 585 link_class = self.db.classes[propclass.classname]
586 for entry in v: 586 for entry in v:
587 if not num_re.match(entry): 587 if entry == '-1': entry = None
588 elif not num_re.match(entry):
588 try: 589 try:
589 entry = link_class.lookup(entry) 590 entry = link_class.lookup(entry)
590 except: 591 except:
591 raise ValueError, 'new property "%s": %s not a %s'%( 592 raise ValueError, 'property "%s": %s not a %s'%(
592 k, entry, self.properties[k].classname) 593 k, entry, self.properties[k].classname)
593 u.append(entry) 594 u.append(entry)
594 595
595 l.append((0, k, u)) 596 l.append((0, k, u))
596 elif isinstance(propclass, Multilink): 597 elif isinstance(propclass, Multilink):
844 cl.create(name=option[i], order=i) 845 cl.create(name=option[i], order=i)
845 return hyperdb.Link(name) 846 return hyperdb.Link(name)
846 847
847 # 848 #
848 # $Log: not supported by cvs2svn $ 849 # $Log: not supported by cvs2svn $
850 # Revision 1.27 2001/10/20 23:44:27 richard
851 # Hyperdatabase sorts strings-that-look-like-numbers as numbers now.
852 #
849 # Revision 1.26 2001/10/16 03:48:01 richard 853 # Revision 1.26 2001/10/16 03:48:01 richard
850 # admin tool now complains if a "find" is attempted with a non-link property. 854 # admin tool now complains if a "find" is attempted with a non-link property.
851 # 855 #
852 # Revision 1.25 2001/10/11 00:17:51 richard 856 # Revision 1.25 2001/10/11 00:17:51 richard
853 # Reverted a change in hyperdb so the default value for missing property 857 # Reverted a change in hyperdb so the default value for missing property

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