diff roundup/cgi/actions.py @ 3635:53987aa153d2

Transitive-property support. - Fixed some of the pet-peeves from pep8 - Better parameter names for new _subselect method - use new-style class for support.Proptree but needed a new-style class for the property I introduced anyway. - Fix a bug where searching did the wrong thing (interestingly enough the same wrong thing for all backends): A search for {'messages': ['1'], 'messages.author': ['2']} would ignore the 'messages' part (messages being non-leaf node in proptree). Fixed and added a regression test for this. - Added the transitive searching to the SearchAction. New method get_transitive_prop introduced in hyperdb that does the transitive version of getprops()[name]. Fixed two tests to use the (faked) method instead of getprop. Now searching for transitive props via the web-interface works for me. Thanks to alexander smishlajev for pointing me at the coding style. Sorry for stepping on the peeves -- I'm using a different coding style in most other projects I'm doing ...
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Thu, 13 Jul 2006 10:14:56 +0000
parents ccf516e6c3f8
children 94b905502d26
line wrap: on
line diff
--- a/roundup/cgi/actions.py	Sat Jul 08 18:28:18 2006 +0000
+++ b/roundup/cgi/actions.py	Thu Jul 13 10:14:56 2006 +0000
@@ -1,4 +1,4 @@
-#$Id: actions.py,v 1.60 2006-04-27 03:44:47 richard Exp $
+#$Id: actions.py,v 1.61 2006-07-13 10:14:56 schlatterbeck Exp $
 
 import re, cgi, StringIO, urllib, Cookie, time, random, csv, codecs
 
@@ -221,9 +221,10 @@
 
     def fakeFilterVars(self):
         """Add a faked :filter form variable for each filtering prop."""
-        props = self.db.classes[self.classname].getprops()
+        cls = self.db.classes[self.classname]
         for key in self.form.keys():
-            if not props.has_key(key):
+            prop = cls.get_transitive_prop(key)
+            if not prop:
                 continue
             if isinstance(self.form[key], type([])):
                 # search for at least one entry which is not empty
@@ -235,7 +236,7 @@
             else:
                 if not self.form[key].value:
                     continue
-                if isinstance(props[key], hyperdb.String):
+                if isinstance(prop, hyperdb.String):
                     v = self.form[key].value
                     l = token.token_split(v)
                     if len(l) > 1 or l[0] != v:

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