Commit f7d0708
Ralf Schlatterbeck
Implemented what I'll call for now "transitive searching"...
...using the filter method. The first idea was mentioned on the
roundup-users mailing list:
http://article.gmane.org/gmane.comp.bug-tracking.roundup.user/6909
We can now search for items which link transitively to other classes
using filter. An example is searching for all items where a certain user
has added a message in the last week:
db.issue.filter (None, {'messages.author' : '42', 'messages.date' : '.-1w;'})
or more readable (but not exactly semantically equivalent, if you're
searching for multiple users in this way it will fail, because string
searches are ANDed): {'messages.author.username':'ralf', ...
We can even extend this further, look for all items that were changed by
users belonging to a certain department (having the same supervisor -- a
property that is not in the user class in standard roundup) in the last
week, the filterspec would be:
{'messages.author.supervisor' : '42', 'messages.date' : '.-1w;'}
If anybody wants to suggest another name instead of transitive
searching, you're welcome.
I've implemented a generic method for this in hyperdb.py -- the backend
now implements _filter in this case. With the generic method, anydbm and
metakit should work (anydbm is tested, metakit breaks for other
reasons). A backend may chose to implement the real transitive filter
itself. This was done for rdbms_common.py. It now has an implementation
of filter that supports transitive searching by creating one big join in
the generated SQL query.
I've added several new regression tests to test for the new features.
All the tests (not just the new ones) run through on python2.3 and
python2.4 with postgres, mysql, sqlite, anydbm -- but metakit was
already broken when I started.
I've generated a tag before commit called 'rsc_before_transitive_search'
and will create the 'after' tag after this commit, so you can merge out
my changes if you don't like them -- if you like them I can remove the
tags.
.-- Ralf1 parent 8f8471d commit f7d0708
File tree
6 files changed
+262
-44
lines changed- roundup
- backends
- test
6 files changed
+262
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
1531 | 1531 | | |
1532 | 1532 | | |
1533 | 1533 | | |
1534 | | - | |
| 1534 | + | |
1535 | 1535 | | |
1536 | 1536 | | |
1537 | 1537 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
1155 | 1155 | | |
1156 | 1156 | | |
1157 | 1157 | | |
1158 | | - | |
| 1158 | + | |
1159 | 1159 | | |
1160 | 1160 | | |
1161 | 1161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
2048 | 2048 | | |
2049 | 2049 | | |
2050 | 2050 | | |
2051 | | - | |
| 2051 | + | |
2052 | 2052 | | |
2053 | 2053 | | |
2054 | 2054 | | |
| |||
2058 | 2058 | | |
2059 | 2059 | | |
2060 | 2060 | | |
2061 | | - | |
2062 | 2061 | | |
2063 | | - | |
2064 | | - | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
2065 | 2085 | | |
2066 | | - | |
| 2086 | + | |
2067 | 2087 | | |
2068 | | - | |
| 2088 | + | |
2069 | 2089 | | |
2070 | 2090 | | |
2071 | 2091 | | |
2072 | | - | |
| 2092 | + | |
2073 | 2093 | | |
2074 | 2094 | | |
2075 | 2095 | | |
2076 | | - | |
| 2096 | + | |
2077 | 2097 | | |
2078 | 2098 | | |
2079 | 2099 | | |
2080 | 2100 | | |
2081 | | - | |
| 2101 | + | |
2082 | 2102 | | |
2083 | 2103 | | |
2084 | 2104 | | |
2085 | 2105 | | |
2086 | 2106 | | |
2087 | | - | |
| 2107 | + | |
2088 | 2108 | | |
2089 | 2109 | | |
2090 | | - | |
| 2110 | + | |
2091 | 2111 | | |
2092 | 2112 | | |
2093 | 2113 | | |
| |||
2100 | 2120 | | |
2101 | 2121 | | |
2102 | 2122 | | |
2103 | | - | |
| 2123 | + | |
2104 | 2124 | | |
2105 | 2125 | | |
2106 | 2126 | | |
| |||
2113 | 2133 | | |
2114 | 2134 | | |
2115 | 2135 | | |
2116 | | - | |
| 2136 | + | |
2117 | 2137 | | |
2118 | 2138 | | |
2119 | 2139 | | |
2120 | | - | |
| 2140 | + | |
2121 | 2141 | | |
2122 | 2142 | | |
2123 | 2143 | | |
2124 | 2144 | | |
2125 | 2145 | | |
2126 | 2146 | | |
2127 | | - | |
| 2147 | + | |
2128 | 2148 | | |
2129 | | - | |
| 2149 | + | |
2130 | 2150 | | |
2131 | 2151 | | |
2132 | 2152 | | |
2133 | 2153 | | |
2134 | 2154 | | |
2135 | | - | |
| 2155 | + | |
2136 | 2156 | | |
2137 | 2157 | | |
2138 | 2158 | | |
2139 | 2159 | | |
2140 | 2160 | | |
2141 | 2161 | | |
2142 | | - | |
| 2162 | + | |
2143 | 2163 | | |
2144 | 2164 | | |
2145 | | - | |
| 2165 | + | |
2146 | 2166 | | |
2147 | 2167 | | |
2148 | 2168 | | |
| |||
2151 | 2171 | | |
2152 | 2172 | | |
2153 | 2173 | | |
2154 | | - | |
| 2174 | + | |
2155 | 2175 | | |
2156 | 2176 | | |
2157 | 2177 | | |
2158 | 2178 | | |
2159 | 2179 | | |
2160 | 2180 | | |
2161 | | - | |
| 2181 | + | |
2162 | 2182 | | |
2163 | 2183 | | |
2164 | | - | |
| 2184 | + | |
2165 | 2185 | | |
2166 | 2186 | | |
2167 | 2187 | | |
2168 | 2188 | | |
2169 | 2189 | | |
2170 | 2190 | | |
2171 | 2191 | | |
2172 | | - | |
| 2192 | + | |
2173 | 2193 | | |
2174 | 2194 | | |
2175 | | - | |
| 2195 | + | |
2176 | 2196 | | |
2177 | 2197 | | |
| 2198 | + | |
| 2199 | + | |
2178 | 2200 | | |
2179 | | - | |
| 2201 | + | |
2180 | 2202 | | |
2181 | 2203 | | |
2182 | 2204 | | |
2183 | 2205 | | |
2184 | 2206 | | |
2185 | | - | |
| 2207 | + | |
2186 | 2208 | | |
2187 | 2209 | | |
2188 | 2210 | | |
| |||
2208 | 2230 | | |
2209 | 2231 | | |
2210 | 2232 | | |
2211 | | - | |
| 2233 | + | |
2212 | 2234 | | |
2213 | 2235 | | |
2214 | 2236 | | |
| |||
2219 | 2241 | | |
2220 | 2242 | | |
2221 | 2243 | | |
2222 | | - | |
| 2244 | + | |
2223 | 2245 | | |
2224 | | - | |
| 2246 | + | |
2225 | 2247 | | |
2226 | 2248 | | |
2227 | 2249 | | |
2228 | 2250 | | |
2229 | 2251 | | |
2230 | 2252 | | |
2231 | | - | |
| 2253 | + | |
2232 | 2254 | | |
2233 | 2255 | | |
2234 | 2256 | | |
| |||
2237 | 2259 | | |
2238 | 2260 | | |
2239 | 2261 | | |
2240 | | - | |
| 2262 | + | |
2241 | 2263 | | |
2242 | | - | |
| 2264 | + | |
2243 | 2265 | | |
2244 | 2266 | | |
2245 | 2267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
709 | 740 | | |
710 | 741 | | |
711 | 742 | | |
| |||
714 | 745 | | |
715 | 746 | | |
716 | 747 | | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
717 | 754 | | |
718 | 755 | | |
719 | 756 | | |
| |||
724 | 761 | | |
725 | 762 | | |
726 | 763 | | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
727 | 771 | | |
728 | | - | |
| 772 | + | |
| 773 | + | |
729 | 774 | | |
730 | 775 | | |
731 | 776 | | |
| |||
0 commit comments