Merge lp:~cr3/launchpad/hwsubmissionset_search into lp:launchpad/db-devel
- hwsubmissionset_search
- Merge into db-devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Robert Collins | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 10711 | ||||
Proposed branch: | lp:~cr3/launchpad/hwsubmissionset_search | ||||
Merge into: | lp:launchpad/db-devel | ||||
Diff against target: |
324 lines (+241/-3) 6 files modified
database/schema/patch-2208-73-2.sql (+12/-0) lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+1/-1) lib/canonical/launchpad/systemhomes.py (+13/-0) lib/lp/hardwaredb/interfaces/hwdb.py (+110/-1) lib/lp/hardwaredb/model/hwdb.py (+11/-1) lib/lp/hardwaredb/stories/webservice/xx-hwdb.txt (+94/-0) |
||||
To merge this branch: | bzr merge lp:~cr3/launchpad/hwsubmissionset_search | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Collins (community) | Approve | ||
Stuart Bishop (community) | db | Approve | |
Canonical Launchpad Engineering | Pending | ||
Review via email: mp+63768@code.launchpad.net |
Commit message
[r=lifeless,stub][bug=801334] Exposing IHWSubmissionSe
Description of the change
Added two indexes to the hwsubmission table to account for searching hwsubmissions by date_created and date_submitted respectively. No sampledata was necessary.
Stuart Bishop (stub) wrote : | # |
The indexes can also be created live if we need this active sooner than next month's rollout. There is more branch juggling to do though, as your code needs to land on launchpad/devel and the db patch (with a different number) landed on launchpad/db-devel.
Stuart Bishop (stub) wrote : | # |
I've just added a review request for the code to be reviewed.
Marc Tardif (cr3) wrote : | # |
Applied all the changes you requested and pushed to the same branch. As for creating the indexes live, your offer is much appreciated but I'll first evaluate the performance on the production database once the code is deployed. If I get timeouts, then I'll consider your offer. Thanks!
Robert Collins (lifeless) wrote : | # |
Code wise - a few thoughts.
The function signature you've added confuses me.
What does this mean:
+ :param submitted_before: Limit results to submissions submitted
78 + before this date inclusively.
79 + :param submitted_after: Limit results to submissions submitted
80 + after this date exclusively.
The inclusive and exclusive bits could refer to being a half-open or closed range endpoint, or to the way that the constraint is connected to the rest of the search.
Perhaps a better thing to say is 'Exclude results submitted after this date'; 'Exclude results submitted before or on this date'
There is one little nit on style, which you can ignore if you like (though the next person through will likely tidy it up: vertical whitespace in a function is frowned upon in PEP8: '
Use blank lines in functions, sparingly, to indicate logical sections.
'
The fact you're extending a doctest is killing baby kittens in alaska. Did you consider unit testing this?
Stub, we could make this a -1 patch can't we? That way it can all land on devel and we can do the indices live? hwsubmissions are our current #1 timeout...
Stuart Bishop (stub) wrote : | # |
> Otherwise fine. patch-2208-74-0.sql
>
> Rename the db patch to that name, change the LaunchpadDataba
> match and you are good to land from a db pov.
Please use the patch number 2208-73-1.sql instead. This will fit in better with our deployment streamlining work.
Robert Collins (lifeless) wrote : | # |
@Marc once you do stuarts last change and address the clarity stuff I mentioned we can land this; I've marked it approved - their is no need to go through another review round-trip (but if you can't land it yourself, please do ping an lp dev once you've made the changes to do the landing for you).
Marc Tardif (cr3) wrote : | # |
> Perhaps a better thing to say is 'Exclude results submitted after this
> date'; 'Exclude results submitted before or on this date'
Done.
> Use blank lines in functions, sparingly, to indicate logical sections.
I typically consider each conditional statement as a logical section but
I can appreciate how this can result in lots of vertical noise, so I've
increased the signal.
> The fact you're extending a doctest is killing baby kittens in
> alaska. Did you consider unit testing this?
I was torn between writing a new set of unit tests or extending the
existing code base which was relying on doctests. I agree the former
would've been preferable but would've been a much more significant
undertaking than the patch itself. So, if the hwdb is likely to get
more attention, then I think it'll be worthwhile to move the existing
doctests to unit tests and save a few kittens in the process.
> Stub, we could make this a -1 patch can't we? That way it can all land
> on devel and we can do the indices live? hwsubmissions are our current
> #1 timeout...
I renamed the patch following stub's comment and made sure to update
LaunchpadDataba
in #launchpad-dev to help with landing the patch.
Thanks for all the advice!
Stuart Bishop (stub) wrote : | # |
Bah. I need to improve my nodes.
patch-2208-73-2.sql
Sorry about that. Working out bugs in the new system :)
Marc Tardif (cr3) wrote : | # |
Done, renamed the patch again and made sure to update LaunchpadDataba
Preview Diff
1 | === added file 'database/schema/patch-2208-73-2.sql' | |||
2 | --- database/schema/patch-2208-73-2.sql 1970-01-01 00:00:00 +0000 | |||
3 | +++ database/schema/patch-2208-73-2.sql 2011-06-16 13:11:48 +0000 | |||
4 | @@ -0,0 +1,12 @@ | |||
5 | 1 | -- Copyright 2011 Canonical Ltd. This software is licensed under the | ||
6 | 2 | -- GNU Affero General Public License version 3 (see the file LICENSE). | ||
7 | 3 | |||
8 | 4 | SET client_min_messages=ERROR; | ||
9 | 5 | |||
10 | 6 | -- For IHWSubmissionSet, which can now search by date_created. | ||
11 | 7 | CREATE INDEX hwsubmission__date_created__idx ON hwsubmission USING btree (date_created); | ||
12 | 8 | |||
13 | 9 | -- For IHWSubmissionSet, which can now search by date_submitted. | ||
14 | 10 | CREATE INDEX hwsubmission__date_submitted__idx ON hwsubmission USING btree (date_submitted); | ||
15 | 11 | |||
16 | 12 | INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 73, 2); | ||
17 | 0 | 13 | ||
18 | === modified file 'lib/canonical/launchpad/interfaces/_schema_circular_imports.py' | |||
19 | --- lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2011-06-11 00:49:33 +0000 | |||
20 | +++ lib/canonical/launchpad/interfaces/_schema_circular_imports.py 2011-06-16 13:11:48 +0000 | |||
21 | @@ -894,7 +894,7 @@ | |||
22 | 894 | patch_operations_explicit_version( | 894 | patch_operations_explicit_version( |
23 | 895 | IHWDBApplication, 'beta', "deviceDriverOwnersAffectedByBugs", "devices", | 895 | IHWDBApplication, 'beta', "deviceDriverOwnersAffectedByBugs", "devices", |
24 | 896 | "drivers", "hwInfoByBugRelatedUsers", "numDevicesInSubmissions", | 896 | "drivers", "hwInfoByBugRelatedUsers", "numDevicesInSubmissions", |
26 | 897 | "numOwnersOfDevice", "numSubmissionsWithDevice", "vendorIDs") | 897 | "numOwnersOfDevice", "numSubmissionsWithDevice", "search", "vendorIDs") |
27 | 898 | 898 | ||
28 | 899 | # IHWDevice | 899 | # IHWDevice |
29 | 900 | patch_entry_explicit_version(IHWDevice, 'beta') | 900 | patch_entry_explicit_version(IHWDevice, 'beta') |
30 | 901 | 901 | ||
31 | === modified file 'lib/canonical/launchpad/systemhomes.py' | |||
32 | --- lib/canonical/launchpad/systemhomes.py 2011-01-21 21:42:40 +0000 | |||
33 | +++ lib/canonical/launchpad/systemhomes.py 2011-06-16 13:11:48 +0000 | |||
34 | @@ -296,6 +296,19 @@ | |||
35 | 296 | """See `IHWDBApplication`.""" | 296 | """See `IHWDBApplication`.""" |
36 | 297 | return getUtility(IHWDriverSet).all_package_names() | 297 | return getUtility(IHWDriverSet).all_package_names() |
37 | 298 | 298 | ||
38 | 299 | def search(self, user=None, device=None, driver=None, distribution=None, | ||
39 | 300 | distroseries=None, architecture=None, owner=None, | ||
40 | 301 | created_before=None, created_after=None, | ||
41 | 302 | submitted_before=None, submitted_after=None): | ||
42 | 303 | """See `IHWDBApplication`.""" | ||
43 | 304 | return getUtility(IHWSubmissionSet).search( | ||
44 | 305 | user=user, device=device, driver=driver, | ||
45 | 306 | distribution=distribution, distroseries=distroseries, | ||
46 | 307 | architecture=architecture, owner=owner, | ||
47 | 308 | created_before=created_before, created_after=created_after, | ||
48 | 309 | submitted_before=submitted_before, | ||
49 | 310 | submitted_after=submitted_after) | ||
50 | 311 | |||
51 | 299 | def getDistroTarget(self, distribution, distroseries, distroarchseries): | 312 | def getDistroTarget(self, distribution, distroseries, distroarchseries): |
52 | 300 | distro_targets = [ | 313 | distro_targets = [ |
53 | 301 | target for target in ( | 314 | target for target in ( |
54 | 302 | 315 | ||
55 | === modified file 'lib/lp/hardwaredb/interfaces/hwdb.py' | |||
56 | --- lib/lp/hardwaredb/interfaces/hwdb.py 2011-02-24 15:30:54 +0000 | |||
57 | +++ lib/lp/hardwaredb/interfaces/hwdb.py 2011-06-16 13:11:48 +0000 | |||
58 | @@ -283,7 +283,9 @@ | |||
59 | 283 | """ | 283 | """ |
60 | 284 | 284 | ||
61 | 285 | def search(user=None, device=None, driver=None, distribution=None, | 285 | def search(user=None, device=None, driver=None, distribution=None, |
63 | 286 | distroseries=None, architecture=None, owner=None): | 286 | distroseries=None, architecture=None, owner=None, |
64 | 287 | created_before=None, created_after=None, | ||
65 | 288 | submitted_before=None, submitted_after=None): | ||
66 | 287 | """Return the submissions matiching the given parmeters. | 289 | """Return the submissions matiching the given parmeters. |
67 | 288 | 290 | ||
68 | 289 | :param user: The `IPerson` running the query. Private submissions | 291 | :param user: The `IPerson` running the query. Private submissions |
69 | @@ -300,6 +302,14 @@ | |||
70 | 300 | :param architecture: Limit results to submissions made for | 302 | :param architecture: Limit results to submissions made for |
71 | 301 | a specific architecture. | 303 | a specific architecture. |
72 | 302 | :param owner: Limit results to submissions from this person. | 304 | :param owner: Limit results to submissions from this person. |
73 | 305 | :param created_before: Exclude results created after this | ||
74 | 306 | date. | ||
75 | 307 | :param created_after: Exclude results created before or on | ||
76 | 308 | this date. | ||
77 | 309 | :param submitted_before: Exclude results submitted after this | ||
78 | 310 | date. | ||
79 | 311 | :param submitted_after: Exclude results submitted before or on | ||
80 | 312 | this date. | ||
81 | 303 | 313 | ||
82 | 304 | Only one of :distribution: or :distroseries: may be supplied. | 314 | Only one of :distribution: or :distroseries: may be supplied. |
83 | 305 | """ | 315 | """ |
84 | @@ -1235,6 +1245,105 @@ | |||
85 | 1235 | readonly=True)) | 1245 | readonly=True)) |
86 | 1236 | 1246 | ||
87 | 1237 | @operation_parameters( | 1247 | @operation_parameters( |
88 | 1248 | device=Reference( | ||
89 | 1249 | IHWDevice, | ||
90 | 1250 | title=u'A Device', | ||
91 | 1251 | description=( | ||
92 | 1252 | u'If specified, the result set is limited to submissions ' | ||
93 | 1253 | u'containing this device.'), | ||
94 | 1254 | required=False), | ||
95 | 1255 | driver=Reference( | ||
96 | 1256 | IHWDriver, | ||
97 | 1257 | title=u'A Driver', | ||
98 | 1258 | description=( | ||
99 | 1259 | u'If specified, the result set is limited to submissions ' | ||
100 | 1260 | u'containing devices that use this driver.'), | ||
101 | 1261 | required=False), | ||
102 | 1262 | distribution=Reference( | ||
103 | 1263 | IDistribution, | ||
104 | 1264 | title=u'A Distribution', | ||
105 | 1265 | description=( | ||
106 | 1266 | u'If specified, the result set is limited to submissions ' | ||
107 | 1267 | u'made for this distribution.'), | ||
108 | 1268 | required=False), | ||
109 | 1269 | distroseries=Reference( | ||
110 | 1270 | IDistroSeries, | ||
111 | 1271 | title=u'A Distribution Series', | ||
112 | 1272 | description=( | ||
113 | 1273 | u'If specified, the result set is limited to submissions ' | ||
114 | 1274 | u'made for the given distribution series.'), | ||
115 | 1275 | required=False), | ||
116 | 1276 | architecture=TextLine( | ||
117 | 1277 | title=u'A processor architecture', | ||
118 | 1278 | description= | ||
119 | 1279 | u'If specified, the result set is limited to sumbissions ' | ||
120 | 1280 | 'made for a specific architecture.', | ||
121 | 1281 | required=False), | ||
122 | 1282 | owner=Reference( | ||
123 | 1283 | IPerson, | ||
124 | 1284 | title=u'Person', | ||
125 | 1285 | description= | ||
126 | 1286 | u'If specified, the result set is limited to sumbissions ' | ||
127 | 1287 | 'from this person.', | ||
128 | 1288 | required=False), | ||
129 | 1289 | created_before=Datetime( | ||
130 | 1290 | title=u'Created Before', | ||
131 | 1291 | description= | ||
132 | 1292 | u'If specified, exclude results created after this date.', | ||
133 | 1293 | required=False), | ||
134 | 1294 | created_after=Datetime( | ||
135 | 1295 | title=u'Created After', | ||
136 | 1296 | description= | ||
137 | 1297 | u'If specified, exclude results created before or on ' | ||
138 | 1298 | 'this date.', | ||
139 | 1299 | required=False), | ||
140 | 1300 | submitted_before=Datetime( | ||
141 | 1301 | title=u'Created Before', | ||
142 | 1302 | description= | ||
143 | 1303 | u'If specified, exclude results submitted after this date.', | ||
144 | 1304 | required=False), | ||
145 | 1305 | submitted_after=Datetime( | ||
146 | 1306 | title=u'Created After', | ||
147 | 1307 | description= | ||
148 | 1308 | u'If specified, Exclude results submitted before or on ' | ||
149 | 1309 | 'this date.', | ||
150 | 1310 | required=False)) | ||
151 | 1311 | @call_with(user=REQUEST_USER) | ||
152 | 1312 | @operation_returns_collection_of(IHWSubmission) | ||
153 | 1313 | @export_read_operation() | ||
154 | 1314 | def search(user=None, device=None, driver=None, distribution=None, | ||
155 | 1315 | distroseries=None, architecture=None, owner=None, | ||
156 | 1316 | created_before=None, created_after=None, | ||
157 | 1317 | submitted_before=None, submitted_after=None): | ||
158 | 1318 | """Return the submissions matiching the given parmeters. | ||
159 | 1319 | |||
160 | 1320 | :param user: The `IPerson` running the query. Private submissions | ||
161 | 1321 | are returned only if the person running the query is the | ||
162 | 1322 | owner or an admin. | ||
163 | 1323 | :param device: Limit results to submissions containing this | ||
164 | 1324 | `IHWDevice`. | ||
165 | 1325 | :param driver: Limit results to submissions containing devices | ||
166 | 1326 | that use this `IHWDriver`. | ||
167 | 1327 | :param distribution: Limit results to submissions made for | ||
168 | 1328 | this `IDistribution`. | ||
169 | 1329 | :param distroseries: Limit results to submissions made for | ||
170 | 1330 | this `IDistroSeries`. | ||
171 | 1331 | :param architecture: Limit results to submissions made for | ||
172 | 1332 | a specific architecture. | ||
173 | 1333 | :param owner: Limit results to submissions from this person. | ||
174 | 1334 | :param created_before: Exclude results created after this | ||
175 | 1335 | date. | ||
176 | 1336 | :param created_after: Exclude results created before or on | ||
177 | 1337 | this date. | ||
178 | 1338 | :param submitted_before: Exclude results submitted after this | ||
179 | 1339 | date. | ||
180 | 1340 | :param submitted_after: Exclude results submitted before or on | ||
181 | 1341 | this date. | ||
182 | 1342 | |||
183 | 1343 | Only one of :distribution: or :distroseries: may be supplied. | ||
184 | 1344 | """ | ||
185 | 1345 | |||
186 | 1346 | @operation_parameters( | ||
187 | 1238 | bus=Choice( | 1347 | bus=Choice( |
188 | 1239 | title=u'The device bus', vocabulary=HWBus, required=False), | 1348 | title=u'The device bus', vocabulary=HWBus, required=False), |
189 | 1240 | vendor_id=TextLine( | 1349 | vendor_id=TextLine( |
190 | 1241 | 1350 | ||
191 | === modified file 'lib/lp/hardwaredb/model/hwdb.py' | |||
192 | --- lib/lp/hardwaredb/model/hwdb.py 2011-05-27 21:12:25 +0000 | |||
193 | +++ lib/lp/hardwaredb/model/hwdb.py 2011-06-16 13:11:48 +0000 | |||
194 | @@ -294,7 +294,9 @@ | |||
195 | 294 | return result_set | 294 | return result_set |
196 | 295 | 295 | ||
197 | 296 | def search(self, user=None, device=None, driver=None, distribution=None, | 296 | def search(self, user=None, device=None, driver=None, distribution=None, |
199 | 297 | distroseries=None, architecture=None, owner=None): | 297 | distroseries=None, architecture=None, owner=None, |
200 | 298 | created_before=None, created_after=None, | ||
201 | 299 | submitted_before=None, submitted_after=None): | ||
202 | 298 | """See `IHWSubmissionSet`.""" | 300 | """See `IHWSubmissionSet`.""" |
203 | 299 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) | 301 | store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR) |
204 | 300 | args = [] | 302 | args = [] |
205 | @@ -330,6 +332,14 @@ | |||
206 | 330 | args.append(DistroArchSeries.distroseries == distroseries.id) | 332 | args.append(DistroArchSeries.distroseries == distroseries.id) |
207 | 331 | if owner is not None: | 333 | if owner is not None: |
208 | 332 | args.append(HWSubmission.owner == owner.id) | 334 | args.append(HWSubmission.owner == owner.id) |
209 | 335 | if created_before is not None: | ||
210 | 336 | args.append(HWSubmission.date_created <= created_before) | ||
211 | 337 | if created_after is not None: | ||
212 | 338 | args.append(HWSubmission.date_created > created_after) | ||
213 | 339 | if submitted_before is not None: | ||
214 | 340 | args.append(HWSubmission.date_submitted <= submitted_before) | ||
215 | 341 | if submitted_after is not None: | ||
216 | 342 | args.append(HWSubmission.date_submitted > submitted_after) | ||
217 | 333 | 343 | ||
218 | 334 | result_set = store.find( | 344 | result_set = store.find( |
219 | 335 | HWSubmission, | 345 | HWSubmission, |
220 | 336 | 346 | ||
221 | === modified file 'lib/lp/hardwaredb/stories/webservice/xx-hwdb.txt' | |||
222 | --- lib/lp/hardwaredb/stories/webservice/xx-hwdb.txt 2011-02-13 22:54:48 +0000 | |||
223 | +++ lib/lp/hardwaredb/stories/webservice/xx-hwdb.txt 2011-06-16 13:11:48 +0000 | |||
224 | @@ -711,6 +711,100 @@ | |||
225 | 711 | ... | 711 | ... |
226 | 712 | 712 | ||
227 | 713 | 713 | ||
228 | 714 | === Searching for submissions === | ||
229 | 715 | |||
230 | 716 | Alternatively, we can also search for hardware submissions by user: | ||
231 | 717 | |||
232 | 718 | >>> owner = webservice.getAbsoluteUrl('/~name12') | ||
233 | 719 | >>> submissions = webservice.get( | ||
234 | 720 | ... '/+hwdb?ws.op=search&owner=%s' % owner).jsonBody() | ||
235 | 721 | >>> print submissions['total_size'] | ||
236 | 722 | 2 | ||
237 | 723 | |||
238 | 724 | >>> owner = webservice.getAbsoluteUrl('/~name20') | ||
239 | 725 | >>> submissions = webservice.get( | ||
240 | 726 | ... '/+hwdb?ws.op=search&owner=%s' % owner).jsonBody() | ||
241 | 727 | >>> print submissions['total_size'] | ||
242 | 728 | 0 | ||
243 | 729 | |||
244 | 730 | ...and by device: | ||
245 | 731 | |||
246 | 732 | >>> device = webservice.getAbsoluteUrl('/+hwdb/+device/1') | ||
247 | 733 | >>> submissions = webservice.named_get( | ||
248 | 734 | ... '/+hwdb', 'search', device=device).jsonBody() | ||
249 | 735 | >>> print submissions['total_size'] | ||
250 | 736 | 1 | ||
251 | 737 | |||
252 | 738 | ...and by driver: | ||
253 | 739 | |||
254 | 740 | >>> driver = webservice.getAbsoluteUrl('/+hwdb/+driver/1') | ||
255 | 741 | >>> submissions = webservice.named_get( | ||
256 | 742 | ... '/+hwdb', 'search', driver=driver).jsonBody() | ||
257 | 743 | >>> print submissions['total_size'] | ||
258 | 744 | 1 | ||
259 | 745 | |||
260 | 746 | ...and by distribution: | ||
261 | 747 | |||
262 | 748 | >>> ubuntu_url = webservice.getAbsoluteUrl('/ubuntu') | ||
263 | 749 | >>> submissions = webservice.named_get( | ||
264 | 750 | ... '/+hwdb', 'search', distribution=ubuntu_url).jsonBody() | ||
265 | 751 | >>> print submissions['total_size'] | ||
266 | 752 | 1 | ||
267 | 753 | >>> debian_url = webservice.getAbsoluteUrl('/debian') | ||
268 | 754 | >>> submissions = webservice.named_get( | ||
269 | 755 | ... '/+hwdb', 'search', distribution=debian_url).jsonBody() | ||
270 | 756 | >>> print submissions['total_size'] | ||
271 | 757 | 0 | ||
272 | 758 | |||
273 | 759 | ...and by distroseries: | ||
274 | 760 | |||
275 | 761 | >>> hoary_url = webservice.getAbsoluteUrl('/ubuntu/hoary') | ||
276 | 762 | >>> submissions = webservice.named_get( | ||
277 | 763 | ... '/+hwdb', 'search', distroseries=hoary_url).jsonBody() | ||
278 | 764 | >>> print submissions['total_size'] | ||
279 | 765 | 1 | ||
280 | 766 | >>> warty_url = webservice.getAbsoluteUrl('/ubuntu/warty') | ||
281 | 767 | >>> submissions = webservice.named_get( | ||
282 | 768 | ... '/+hwdb', 'search', distroseries=warty_url).jsonBody() | ||
283 | 769 | >>> print submissions['total_size'] | ||
284 | 770 | 0 | ||
285 | 771 | |||
286 | 772 | ...and by architecture: | ||
287 | 773 | |||
288 | 774 | >>> submissions = webservice.named_get( | ||
289 | 775 | ... '/+hwdb', 'search', architecture='i386').jsonBody() | ||
290 | 776 | >>> print submissions['total_size'] | ||
291 | 777 | 1 | ||
292 | 778 | >>> submissions = webservice.named_get( | ||
293 | 779 | ... '/+hwdb', 'search', architecture='powerpc').jsonBody() | ||
294 | 780 | >>> print submissions['total_size'] | ||
295 | 781 | 0 | ||
296 | 782 | |||
297 | 783 | ...and by date created: | ||
298 | 784 | |||
299 | 785 | >>> date_created = u'2007-09-11T00:00:00+00:00' | ||
300 | 786 | >>> submissions = webservice.named_get( | ||
301 | 787 | ... '/+hwdb', 'search', created_before=date_created).jsonBody() | ||
302 | 788 | >>> print submissions['total_size'] | ||
303 | 789 | 1 | ||
304 | 790 | >>> submissions = webservice.named_get( | ||
305 | 791 | ... '/+hwdb', 'search', created_after=date_created).jsonBody() | ||
306 | 792 | >>> print submissions['total_size'] | ||
307 | 793 | 1 | ||
308 | 794 | |||
309 | 795 | ...and by date submitted: | ||
310 | 796 | |||
311 | 797 | >>> date_submitted = u'2007-09-11T15:23:45.653316+00:00' | ||
312 | 798 | >>> submissions = webservice.named_get( | ||
313 | 799 | ... '/+hwdb', 'search', submitted_before=date_submitted).jsonBody() | ||
314 | 800 | >>> print submissions['total_size'] | ||
315 | 801 | 1 | ||
316 | 802 | >>> submissions = webservice.named_get( | ||
317 | 803 | ... '/+hwdb', 'search', submitted_after=date_submitted).jsonBody() | ||
318 | 804 | >>> print submissions['total_size'] | ||
319 | 805 | 1 | ||
320 | 806 | |||
321 | 807 | |||
322 | 714 | === Submission Devices === | 808 | === Submission Devices === |
323 | 715 | 809 | ||
324 | 716 | The table HWSubmissionDevice associates devices with submissions. | 810 | The table HWSubmissionDevice associates devices with submissions. |
Minor typo - the second index has '_idx' in its name instead of '__idx' with two underscores.
Otherwise fine. patch-2208-74-0.sql
Rename the db patch to that name, change the LaunchpadDataba seRevision line to match and you are good to land from a db pov.