Merge ~jugmac00/launchpad:sqlobject-is-a-first-party-import into launchpad:master
- Git
- lp:~jugmac00/launchpad
- sqlobject-is-a-first-party-import
- Merge into master
Proposed by
Jürgen Gmach
Status: | Merged |
---|---|
Approved by: | Jürgen Gmach |
Approved revision: | 99adcc9cffa75e69a2e0cb64b0ef76ec73c8c11f |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~jugmac00/launchpad:sqlobject-is-a-first-party-import |
Merge into: | launchpad:master |
Diff against target: |
2238 lines (+333/-340) 89 files modified
lib/lp/answers/model/answercontact.py (+1/-1) lib/lp/answers/vocabulary.py (+1/-1) lib/lp/archiveuploader/uploadprocessor.py (+1/-1) lib/lp/blueprints/model/specification.py (+8/-8) lib/lp/blueprints/model/specificationdependency.py (+1/-1) lib/lp/blueprints/model/specificationmessage.py (+4/-4) lib/lp/bugs/model/bug.py (+8/-8) lib/lp/bugs/model/bugactivity.py (+4/-4) lib/lp/bugs/model/bugattachment.py (+5/-5) lib/lp/bugs/model/bugtracker.py (+8/-8) lib/lp/bugs/model/bugwatch.py (+5/-5) lib/lp/bugs/vocabularies.py (+4/-4) lib/lp/buildmaster/model/processor.py (+1/-1) lib/lp/code/mail/codehandler.py (+1/-1) lib/lp/code/model/branch.py (+5/-5) lib/lp/code/model/branchlookup.py (+1/-1) lib/lp/code/model/branchmergeproposal.py (+5/-5) lib/lp/code/model/branchmergeproposaljob.py (+1/-1) lib/lp/code/model/diff.py (+5/-5) lib/lp/code/model/revision.py (+7/-7) lib/lp/code/model/tests/test_branch.py (+1/-1) lib/lp/code/model/tests/test_branchmergeproposal.py (+1/-1) lib/lp/code/model/tests/test_branchmergeproposaljobs.py (+1/-1) lib/lp/code/model/tests/test_gitrepository.py (+1/-1) lib/lp/registry/model/distribution.py (+6/-6) lib/lp/registry/model/distributionmirror.py (+5/-5) lib/lp/registry/model/distroseries.py (+9/-9) lib/lp/registry/model/distroseriesdifference.py (+1/-1) lib/lp/registry/model/gpgkey.py (+6/-6) lib/lp/registry/model/karma.py (+7/-7) lib/lp/registry/model/milestone.py (+7/-7) lib/lp/registry/model/packaging.py (+1/-1) lib/lp/registry/model/person.py (+8/-8) lib/lp/registry/model/pillar.py (+5/-5) lib/lp/registry/model/product.py (+7/-7) lib/lp/registry/model/productlicense.py (+1/-1) lib/lp/registry/model/productrelease.py (+5/-5) lib/lp/registry/model/productseries.py (+6/-6) lib/lp/registry/model/projectgroup.py (+7/-7) lib/lp/registry/model/series.py (+1/-1) lib/lp/registry/model/sharingjob.py (+1/-1) lib/lp/registry/model/sourcepackagename.py (+5/-5) lib/lp/registry/model/teammembership.py (+4/-4) lib/lp/registry/tests/test_distributionmirror_prober.py (+1/-1) lib/lp/registry/vocabularies.py (+5/-5) lib/lp/services/database/sqlbase.py (+1/-1) lib/lp/services/database/sqlobject/__init__.py (+0/-6) lib/lp/services/identity/model/account.py (+1/-1) lib/lp/services/identity/model/emailaddress.py (+4/-4) lib/lp/services/job/model/job.py (+1/-1) lib/lp/services/librarian/client.py (+1/-1) lib/lp/services/librarian/model.py (+7/-7) lib/lp/services/librarianserver/tests/test_gc.py (+1/-1) lib/lp/services/messages/model/message.py (+8/-8) lib/lp/services/statistics/model/statistics.py (+4/-4) lib/lp/services/verification/model/logintoken.py (+5/-5) lib/lp/services/webapp/vocabulary.py (+4/-4) lib/lp/services/worlddata/model/country.py (+5/-5) lib/lp/services/worlddata/model/language.py (+7/-7) lib/lp/services/worlddata/model/spokenin.py (+1/-1) lib/lp/snappy/browser/snapbase.py (+1/-1) lib/lp/soyuz/browser/archive.py (+1/-1) lib/lp/soyuz/doc/gina.txt (+1/-1) lib/lp/soyuz/model/archive.py (+6/-6) lib/lp/soyuz/model/binarypackagebuild.py (+1/-1) lib/lp/soyuz/model/binarypackagename.py (+4/-4) lib/lp/soyuz/model/binarypackagerelease.py (+6/-6) lib/lp/soyuz/model/component.py (+4/-4) lib/lp/soyuz/model/distributionsourcepackagecache.py (+4/-4) lib/lp/soyuz/model/distroarchseries.py (+8/-8) lib/lp/soyuz/model/distroseriespackagecache.py (+4/-4) lib/lp/soyuz/model/files.py (+1/-1) lib/lp/soyuz/model/packagediff.py (+1/-1) lib/lp/soyuz/model/publishing.py (+5/-5) lib/lp/soyuz/model/queue.py (+6/-6) lib/lp/soyuz/model/section.py (+4/-4) lib/lp/soyuz/model/sourcepackagerelease.py (+5/-5) lib/lp/soyuz/scripts/gina/handlers.py (+1/-1) lib/lp/translations/model/pofile.py (+6/-6) lib/lp/translations/model/pofiletranslator.py (+1/-1) lib/lp/translations/model/potemplate.py (+7/-7) lib/lp/translations/model/potmsgset.py (+1/-1) lib/lp/translations/model/translationgroup.py (+7/-7) lib/lp/translations/model/translationmessage.py (+6/-6) lib/lp/translations/model/translationrelicensingagreement.py (+4/-4) lib/lp/translations/model/translationtemplateitem.py (+4/-4) lib/lp/translations/model/translator.py (+4/-4) lib/lp/translations/scripts/fix_plural_forms.py (+1/-2) lib/lp/translations/vocabularies.py (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+410928@code.launchpad.net |
Commit message
Move the SQLObject wrapper into the lp namespace
Description of the change
To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) wrote (last edit ): | # |
Thanks for the review!
I followed your suggestion.
Additionally, in order to make tests work I needed to remove the following lines from the former sqlobject/
-# Provide the same interface from these other locations.
-sys.modules[
-sys.modules[
-del sys
I searched and the imports are no longer used anywhere, so we should we good.
I will not mark this commit on deployable until you read that message.
At some point we need to merge to get the whole test suite confirm this change is ok.
Revision history for this message
Colin Watson (cjwatson) wrote : | # |
Sounds good to me, thanks.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/lib/lp/answers/model/answercontact.py b/lib/lp/answers/model/answercontact.py |
2 | index dac75e7..53c2be0 100644 |
3 | --- a/lib/lp/answers/model/answercontact.py |
4 | +++ b/lib/lp/answers/model/answercontact.py |
5 | @@ -6,12 +6,12 @@ |
6 | __all__ = ['AnswerContact'] |
7 | |
8 | |
9 | -from sqlobject import ForeignKey |
10 | from zope.interface import implementer |
11 | |
12 | from lp.answers.interfaces.answercontact import IAnswerContact |
13 | from lp.registry.interfaces.person import validate_public_person |
14 | from lp.services.database.sqlbase import SQLBase |
15 | +from lp.services.database.sqlobject import ForeignKey |
16 | |
17 | |
18 | @implementer(IAnswerContact) |
19 | diff --git a/lib/lp/answers/vocabulary.py b/lib/lp/answers/vocabulary.py |
20 | index e60e2cf..ec3ab2d 100644 |
21 | --- a/lib/lp/answers/vocabulary.py |
22 | +++ b/lib/lp/answers/vocabulary.py |
23 | @@ -9,7 +9,6 @@ __all__ = [ |
24 | 'UsesAnswersProductVocabulary', |
25 | ] |
26 | |
27 | -from sqlobject import OR |
28 | from storm.expr import And |
29 | from zope.interface import implementer |
30 | from zope.schema.vocabulary import SimpleTerm |
31 | @@ -22,6 +21,7 @@ from lp.registry.vocabularies import ( |
32 | DistributionVocabulary, |
33 | ProductVocabulary, |
34 | ) |
35 | +from lp.services.database.sqlobject import OR |
36 | from lp.services.webapp.vocabulary import ( |
37 | CountableIterator, |
38 | FilteredVocabularyBase, |
39 | diff --git a/lib/lp/archiveuploader/uploadprocessor.py b/lib/lp/archiveuploader/uploadprocessor.py |
40 | index 2081a51..c5341b0 100644 |
41 | --- a/lib/lp/archiveuploader/uploadprocessor.py |
42 | +++ b/lib/lp/archiveuploader/uploadprocessor.py |
43 | @@ -49,7 +49,6 @@ import os |
44 | import shutil |
45 | import sys |
46 | |
47 | -from sqlobject import SQLObjectNotFound |
48 | from zope.component import getUtility |
49 | |
50 | from lp.app.errors import NotFoundError |
51 | @@ -75,6 +74,7 @@ from lp.code.interfaces.sourcepackagerecipebuild import ( |
52 | from lp.oci.interfaces.ocirecipebuild import IOCIRecipeBuild |
53 | from lp.registry.interfaces.distribution import IDistributionSet |
54 | from lp.registry.interfaces.person import IPersonSet |
55 | +from lp.services.database.sqlobject import SQLObjectNotFound |
56 | from lp.services.log.logger import BufferLogger |
57 | from lp.services.webapp.errorlog import ( |
58 | ErrorReportingUtility, |
59 | diff --git a/lib/lp/blueprints/model/specification.py b/lib/lp/blueprints/model/specification.py |
60 | index 034a7c3..b0e56c0 100644 |
61 | --- a/lib/lp/blueprints/model/specification.py |
62 | +++ b/lib/lp/blueprints/model/specification.py |
63 | @@ -15,14 +15,6 @@ import operator |
64 | from lazr.lifecycle.event import ObjectCreatedEvent |
65 | from lazr.lifecycle.objectdelta import ObjectDelta |
66 | import six |
67 | -from sqlobject import ( |
68 | - BoolCol, |
69 | - ForeignKey, |
70 | - IntCol, |
71 | - SQLMultipleJoin, |
72 | - SQLRelatedJoin, |
73 | - StringCol, |
74 | - ) |
75 | from storm.locals import ( |
76 | Count, |
77 | Desc, |
78 | @@ -101,6 +93,14 @@ from lp.services.database.sqlbase import ( |
79 | SQLBase, |
80 | sqlvalues, |
81 | ) |
82 | +from lp.services.database.sqlobject import ( |
83 | + BoolCol, |
84 | + ForeignKey, |
85 | + IntCol, |
86 | + SQLMultipleJoin, |
87 | + SQLRelatedJoin, |
88 | + StringCol, |
89 | + ) |
90 | from lp.services.mail.helpers import get_contact_email_addresses |
91 | from lp.services.propertycache import ( |
92 | cachedproperty, |
93 | diff --git a/lib/lp/blueprints/model/specificationdependency.py b/lib/lp/blueprints/model/specificationdependency.py |
94 | index 900c123..28d7414 100644 |
95 | --- a/lib/lp/blueprints/model/specificationdependency.py |
96 | +++ b/lib/lp/blueprints/model/specificationdependency.py |
97 | @@ -3,13 +3,13 @@ |
98 | |
99 | __all__ = ['SpecificationDependency'] |
100 | |
101 | -from sqlobject import ForeignKey |
102 | from zope.interface import implementer |
103 | |
104 | from lp.blueprints.interfaces.specificationdependency import ( |
105 | ISpecificationDependency, |
106 | ) |
107 | from lp.services.database.sqlbase import SQLBase |
108 | +from lp.services.database.sqlobject import ForeignKey |
109 | |
110 | |
111 | @implementer(ISpecificationDependency) |
112 | diff --git a/lib/lp/blueprints/model/specificationmessage.py b/lib/lp/blueprints/model/specificationmessage.py |
113 | index c4b8b61..fbafb3d 100644 |
114 | --- a/lib/lp/blueprints/model/specificationmessage.py |
115 | +++ b/lib/lp/blueprints/model/specificationmessage.py |
116 | @@ -8,10 +8,6 @@ __all__ = [ |
117 | |
118 | from email.utils import make_msgid |
119 | |
120 | -from sqlobject import ( |
121 | - BoolCol, |
122 | - ForeignKey, |
123 | - ) |
124 | from zope.interface import implementer |
125 | |
126 | from lp.blueprints.interfaces.specificationmessage import ( |
127 | @@ -19,6 +15,10 @@ from lp.blueprints.interfaces.specificationmessage import ( |
128 | ISpecificationMessageSet, |
129 | ) |
130 | from lp.services.database.sqlbase import SQLBase |
131 | +from lp.services.database.sqlobject import ( |
132 | + BoolCol, |
133 | + ForeignKey, |
134 | + ) |
135 | from lp.services.messages.model.message import ( |
136 | Message, |
137 | MessageChunk, |
138 | diff --git a/lib/lp/bugs/model/bug.py b/lib/lp/bugs/model/bug.py |
139 | index 94f4dfc..8434876 100644 |
140 | --- a/lib/lp/bugs/model/bug.py |
141 | +++ b/lib/lp/bugs/model/bug.py |
142 | @@ -32,14 +32,6 @@ from six.moves.collections_abc import ( |
143 | Iterable, |
144 | Set, |
145 | ) |
146 | -from sqlobject import ( |
147 | - ForeignKey, |
148 | - IntCol, |
149 | - SQLMultipleJoin, |
150 | - SQLObjectNotFound, |
151 | - SQLRelatedJoin, |
152 | - StringCol, |
153 | - ) |
154 | from storm.expr import ( |
155 | And, |
156 | Coalesce, |
157 | @@ -207,6 +199,14 @@ from lp.services.database.sqlbase import ( |
158 | SQLBase, |
159 | sqlvalues, |
160 | ) |
161 | +from lp.services.database.sqlobject import ( |
162 | + ForeignKey, |
163 | + IntCol, |
164 | + SQLMultipleJoin, |
165 | + SQLObjectNotFound, |
166 | + SQLRelatedJoin, |
167 | + StringCol, |
168 | + ) |
169 | from lp.services.database.stormbase import StormBase |
170 | from lp.services.fields import DuplicateBug |
171 | from lp.services.helpers import shortlist |
172 | diff --git a/lib/lp/bugs/model/bugactivity.py b/lib/lp/bugs/model/bugactivity.py |
173 | index ec51800..703a070 100644 |
174 | --- a/lib/lp/bugs/model/bugactivity.py |
175 | +++ b/lib/lp/bugs/model/bugactivity.py |
176 | @@ -5,10 +5,6 @@ __all__ = ['BugActivity', 'BugActivitySet'] |
177 | |
178 | import re |
179 | |
180 | -from sqlobject import ( |
181 | - ForeignKey, |
182 | - StringCol, |
183 | - ) |
184 | from storm.store import Store |
185 | from zope.interface import implementer |
186 | |
187 | @@ -35,6 +31,10 @@ from lp.bugs.interfaces.bugactivity import ( |
188 | from lp.registry.interfaces.person import validate_person |
189 | from lp.services.database.datetimecol import UtcDateTimeCol |
190 | from lp.services.database.sqlbase import SQLBase |
191 | +from lp.services.database.sqlobject import ( |
192 | + ForeignKey, |
193 | + StringCol, |
194 | + ) |
195 | |
196 | |
197 | @implementer(IBugActivity) |
198 | diff --git a/lib/lp/bugs/model/bugattachment.py b/lib/lp/bugs/model/bugattachment.py |
199 | index 44dc0e9..723fa09 100644 |
200 | --- a/lib/lp/bugs/model/bugattachment.py |
201 | +++ b/lib/lp/bugs/model/bugattachment.py |
202 | @@ -7,11 +7,6 @@ from lazr.lifecycle.event import ( |
203 | ObjectCreatedEvent, |
204 | ObjectDeletedEvent, |
205 | ) |
206 | -from sqlobject import ( |
207 | - ForeignKey, |
208 | - SQLObjectNotFound, |
209 | - StringCol, |
210 | - ) |
211 | from storm.store import Store |
212 | from zope.event import notify |
213 | from zope.interface import implementer |
214 | @@ -24,6 +19,11 @@ from lp.bugs.interfaces.bugattachment import ( |
215 | ) |
216 | from lp.services.database.enumcol import EnumCol |
217 | from lp.services.database.sqlbase import SQLBase |
218 | +from lp.services.database.sqlobject import ( |
219 | + ForeignKey, |
220 | + SQLObjectNotFound, |
221 | + StringCol, |
222 | + ) |
223 | from lp.services.propertycache import cachedproperty |
224 | |
225 | |
226 | diff --git a/lib/lp/bugs/model/bugtracker.py b/lib/lp/bugs/model/bugtracker.py |
227 | index b13b90c..c3c5988 100644 |
228 | --- a/lib/lp/bugs/model/bugtracker.py |
229 | +++ b/lib/lp/bugs/model/bugtracker.py |
230 | @@ -21,14 +21,6 @@ from six.moves.urllib.parse import ( |
231 | urlsplit, |
232 | urlunsplit, |
233 | ) |
234 | -from sqlobject import ( |
235 | - BoolCol, |
236 | - ForeignKey, |
237 | - OR, |
238 | - SQLMultipleJoin, |
239 | - SQLObjectNotFound, |
240 | - StringCol, |
241 | - ) |
242 | from storm.expr import ( |
243 | Count, |
244 | Desc, |
245 | @@ -80,6 +72,14 @@ from lp.services.database.sqlbase import ( |
246 | flush_database_updates, |
247 | SQLBase, |
248 | ) |
249 | +from lp.services.database.sqlobject import ( |
250 | + BoolCol, |
251 | + ForeignKey, |
252 | + OR, |
253 | + SQLMultipleJoin, |
254 | + SQLObjectNotFound, |
255 | + StringCol, |
256 | + ) |
257 | from lp.services.database.stormbase import StormBase |
258 | from lp.services.helpers import shortlist |
259 | |
260 | diff --git a/lib/lp/bugs/model/bugwatch.py b/lib/lp/bugs/model/bugwatch.py |
261 | index 5dd88e5..93a8f83 100644 |
262 | --- a/lib/lp/bugs/model/bugwatch.py |
263 | +++ b/lib/lp/bugs/model/bugwatch.py |
264 | @@ -20,11 +20,6 @@ from six.moves.urllib.parse import ( |
265 | splitvalue, |
266 | urlunsplit, |
267 | ) |
268 | -from sqlobject import ( |
269 | - ForeignKey, |
270 | - SQLObjectNotFound, |
271 | - StringCol, |
272 | - ) |
273 | from storm.expr import ( |
274 | Desc, |
275 | Not, |
276 | @@ -68,6 +63,11 @@ from lp.services.database.datetimecol import UtcDateTimeCol |
277 | from lp.services.database.enumcol import EnumCol |
278 | from lp.services.database.interfaces import IStore |
279 | from lp.services.database.sqlbase import SQLBase |
280 | +from lp.services.database.sqlobject import ( |
281 | + ForeignKey, |
282 | + SQLObjectNotFound, |
283 | + StringCol, |
284 | + ) |
285 | from lp.services.database.stormbase import StormBase |
286 | from lp.services.helpers import shortlist |
287 | from lp.services.messages.model.message import Message |
288 | diff --git a/lib/lp/bugs/vocabularies.py b/lib/lp/bugs/vocabularies.py |
289 | index 95d1954..8801a71 100644 |
290 | --- a/lib/lp/bugs/vocabularies.py |
291 | +++ b/lib/lp/bugs/vocabularies.py |
292 | @@ -18,10 +18,6 @@ __all__ = [ |
293 | 'WebBugTrackerVocabulary', |
294 | ] |
295 | |
296 | -from sqlobject import ( |
297 | - CONTAINSSTRING, |
298 | - OR, |
299 | - ) |
300 | from storm.expr import ( |
301 | And, |
302 | Or, |
303 | @@ -64,6 +60,10 @@ from lp.registry.model.milestone import milestone_sort_key |
304 | from lp.registry.model.productseries import ProductSeries |
305 | from lp.registry.vocabularies import DistributionVocabulary |
306 | from lp.services.database.interfaces import IStore |
307 | +from lp.services.database.sqlobject import ( |
308 | + CONTAINSSTRING, |
309 | + OR, |
310 | + ) |
311 | from lp.services.helpers import shortlist |
312 | from lp.services.webapp.escaping import ( |
313 | html_escape, |
314 | diff --git a/lib/lp/buildmaster/model/processor.py b/lib/lp/buildmaster/model/processor.py |
315 | index 68d9581..314e12a 100644 |
316 | --- a/lib/lp/buildmaster/model/processor.py |
317 | +++ b/lib/lp/buildmaster/model/processor.py |
318 | @@ -6,7 +6,6 @@ __all__ = [ |
319 | 'ProcessorSet', |
320 | ] |
321 | |
322 | -from sqlobject import StringCol |
323 | from storm.locals import Bool |
324 | from zope.interface import implementer |
325 | |
326 | @@ -17,6 +16,7 @@ from lp.buildmaster.interfaces.processor import ( |
327 | ) |
328 | from lp.services.database.interfaces import IStore |
329 | from lp.services.database.sqlbase import SQLBase |
330 | +from lp.services.database.sqlobject import StringCol |
331 | |
332 | |
333 | @implementer(IProcessor) |
334 | diff --git a/lib/lp/code/mail/codehandler.py b/lib/lp/code/mail/codehandler.py |
335 | index f149d8b..d6a3ba1 100644 |
336 | --- a/lib/lp/code/mail/codehandler.py |
337 | +++ b/lib/lp/code/mail/codehandler.py |
338 | @@ -5,7 +5,6 @@ import operator |
339 | import os |
340 | import re |
341 | |
342 | -from sqlobject import SQLObjectNotFound |
343 | import transaction |
344 | from zope.component import getUtility |
345 | from zope.interface import implementer |
346 | @@ -16,6 +15,7 @@ from lp.code.enums import CodeReviewVote |
347 | from lp.code.errors import UserNotBranchReviewer |
348 | from lp.code.interfaces.branchmergeproposal import IBranchMergeProposalGetter |
349 | from lp.services.config import config |
350 | +from lp.services.database.sqlobject import SQLObjectNotFound |
351 | from lp.services.mail.commands import ( |
352 | EmailCommand, |
353 | EmailCommandCollection, |
354 | diff --git a/lib/lp/code/model/branch.py b/lib/lp/code/model/branch.py |
355 | index f0dd019..b915da8 100644 |
356 | --- a/lib/lp/code/model/branch.py |
357 | +++ b/lib/lp/code/model/branch.py |
358 | @@ -20,11 +20,6 @@ from lazr.lifecycle.event import ObjectCreatedEvent |
359 | import pytz |
360 | import six |
361 | from six.moves.urllib_parse import urlsplit |
362 | -from sqlobject import ( |
363 | - ForeignKey, |
364 | - IntCol, |
365 | - StringCol, |
366 | - ) |
367 | from storm.expr import ( |
368 | And, |
369 | Coalesce, |
370 | @@ -179,6 +174,11 @@ from lp.services.database.sqlbase import ( |
371 | SQLBase, |
372 | sqlvalues, |
373 | ) |
374 | +from lp.services.database.sqlobject import ( |
375 | + ForeignKey, |
376 | + IntCol, |
377 | + StringCol, |
378 | + ) |
379 | from lp.services.database.stormexpr import ( |
380 | Array, |
381 | ArrayAgg, |
382 | diff --git a/lib/lp/code/model/branchlookup.py b/lib/lp/code/model/branchlookup.py |
383 | index b63d2eb..9648e2a 100644 |
384 | --- a/lib/lp/code/model/branchlookup.py |
385 | +++ b/lib/lp/code/model/branchlookup.py |
386 | @@ -14,7 +14,6 @@ from lazr.uri import ( |
387 | InvalidURIError, |
388 | URI, |
389 | ) |
390 | -from sqlobject import SQLObjectNotFound |
391 | from storm.expr import ( |
392 | And, |
393 | Join, |
394 | @@ -68,6 +67,7 @@ from lp.registry.model.product import Product |
395 | from lp.registry.model.sourcepackagename import SourcePackageName |
396 | from lp.services.config import config |
397 | from lp.services.database.interfaces import IStore |
398 | +from lp.services.database.sqlobject import SQLObjectNotFound |
399 | from lp.services.webapp.authorization import check_permission |
400 | |
401 | |
402 | diff --git a/lib/lp/code/model/branchmergeproposal.py b/lib/lp/code/model/branchmergeproposal.py |
403 | index 3755b55..c3d0c4d 100644 |
404 | --- a/lib/lp/code/model/branchmergeproposal.py |
405 | +++ b/lib/lp/code/model/branchmergeproposal.py |
406 | @@ -19,11 +19,6 @@ from lazr.lifecycle.event import ( |
407 | ObjectDeletedEvent, |
408 | ) |
409 | import six |
410 | -from sqlobject import ( |
411 | - ForeignKey, |
412 | - IntCol, |
413 | - StringCol, |
414 | - ) |
415 | from storm.expr import ( |
416 | And, |
417 | Desc, |
418 | @@ -122,6 +117,11 @@ from lp.services.database.sqlbase import ( |
419 | quote, |
420 | SQLBase, |
421 | ) |
422 | +from lp.services.database.sqlobject import ( |
423 | + ForeignKey, |
424 | + IntCol, |
425 | + StringCol, |
426 | + ) |
427 | from lp.services.helpers import shortlist |
428 | from lp.services.job.interfaces.job import JobStatus |
429 | from lp.services.job.model.job import Job |
430 | diff --git a/lib/lp/code/model/branchmergeproposaljob.py b/lib/lp/code/model/branchmergeproposaljob.py |
431 | index 0430cb8..486fd15 100644 |
432 | --- a/lib/lp/code/model/branchmergeproposaljob.py |
433 | +++ b/lib/lp/code/model/branchmergeproposaljob.py |
434 | @@ -33,7 +33,6 @@ from lazr.enum import ( |
435 | import pytz |
436 | import simplejson |
437 | import six |
438 | -from sqlobject import SQLObjectNotFound |
439 | from storm.expr import ( |
440 | And, |
441 | Desc, |
442 | @@ -88,6 +87,7 @@ from lp.services.database.interfaces import ( |
443 | IMasterStore, |
444 | IStore, |
445 | ) |
446 | +from lp.services.database.sqlobject import SQLObjectNotFound |
447 | from lp.services.database.stormbase import StormBase |
448 | from lp.services.job.interfaces.job import JobStatus |
449 | from lp.services.job.model.job import ( |
450 | diff --git a/lib/lp/code/model/diff.py b/lib/lp/code/model/diff.py |
451 | index 6041c26..abcb25c 100644 |
452 | --- a/lib/lp/code/model/diff.py |
453 | +++ b/lib/lp/code/model/diff.py |
454 | @@ -26,11 +26,6 @@ from breezy.plugins.difftacular.generate_diff import diff_ignore_branches |
455 | from lazr.delegates import delegate_to |
456 | import simplejson |
457 | import six |
458 | -from sqlobject import ( |
459 | - ForeignKey, |
460 | - IntCol, |
461 | - StringCol, |
462 | - ) |
463 | from storm.locals import ( |
464 | Int, |
465 | Reference, |
466 | @@ -53,6 +48,11 @@ from lp.services.config import config |
467 | from lp.services.database.constants import UTC_NOW |
468 | from lp.services.database.datetimecol import UtcDateTimeCol |
469 | from lp.services.database.sqlbase import SQLBase |
470 | +from lp.services.database.sqlobject import ( |
471 | + ForeignKey, |
472 | + IntCol, |
473 | + StringCol, |
474 | + ) |
475 | from lp.services.librarian.interfaces import ILibraryFileAliasSet |
476 | from lp.services.librarian.interfaces.client import ( |
477 | LIBRARIAN_SERVER_DEFAULT_TIMEOUT, |
478 | diff --git a/lib/lp/code/model/revision.py b/lib/lp/code/model/revision.py |
479 | index 27a292e..4958e32 100644 |
480 | --- a/lib/lp/code/model/revision.py |
481 | +++ b/lib/lp/code/model/revision.py |
482 | @@ -18,13 +18,6 @@ import email |
483 | from breezy.revision import NULL_REVISION |
484 | import pytz |
485 | import six |
486 | -from sqlobject import ( |
487 | - BoolCol, |
488 | - ForeignKey, |
489 | - IntCol, |
490 | - SQLMultipleJoin, |
491 | - StringCol, |
492 | - ) |
493 | from storm.expr import ( |
494 | And, |
495 | Asc, |
496 | @@ -71,6 +64,13 @@ from lp.services.database.sqlbase import ( |
497 | quote, |
498 | SQLBase, |
499 | ) |
500 | +from lp.services.database.sqlobject import ( |
501 | + BoolCol, |
502 | + ForeignKey, |
503 | + IntCol, |
504 | + SQLMultipleJoin, |
505 | + StringCol, |
506 | + ) |
507 | from lp.services.helpers import shortlist |
508 | from lp.services.identity.interfaces.emailaddress import ( |
509 | EmailAddressStatus, |
510 | diff --git a/lib/lp/code/model/tests/test_branch.py b/lib/lp/code/model/tests/test_branch.py |
511 | index b3bc7de..9379266 100644 |
512 | --- a/lib/lp/code/model/tests/test_branch.py |
513 | +++ b/lib/lp/code/model/tests/test_branch.py |
514 | @@ -15,7 +15,6 @@ from breezy.revision import NULL_REVISION |
515 | from breezy.url_policy_open import BadUrl |
516 | from pytz import UTC |
517 | import six |
518 | -from sqlobject import SQLObjectNotFound |
519 | from storm.exceptions import LostObjectError |
520 | from storm.locals import Store |
521 | from testtools import ExpectedException |
522 | @@ -132,6 +131,7 @@ from lp.registry.tests.test_accesspolicy import get_policies_for_artifact |
523 | from lp.services.config import config |
524 | from lp.services.database.constants import UTC_NOW |
525 | from lp.services.database.interfaces import IStore |
526 | +from lp.services.database.sqlobject import SQLObjectNotFound |
527 | from lp.services.features.testing import FeatureFixture |
528 | from lp.services.job.interfaces.job import JobStatus |
529 | from lp.services.job.runner import JobRunner |
530 | diff --git a/lib/lp/code/model/tests/test_branchmergeproposal.py b/lib/lp/code/model/tests/test_branchmergeproposal.py |
531 | index fcb6083..3e58e46 100644 |
532 | --- a/lib/lp/code/model/tests/test_branchmergeproposal.py |
533 | +++ b/lib/lp/code/model/tests/test_branchmergeproposal.py |
534 | @@ -16,7 +16,6 @@ from lazr.lifecycle.event import ObjectCreatedEvent |
535 | from lazr.restfulclient.errors import BadRequest |
536 | from pytz import UTC |
537 | import six |
538 | -from sqlobject import SQLObjectNotFound |
539 | from storm.locals import Store |
540 | from testscenarios import ( |
541 | load_tests_apply_scenarios, |
542 | @@ -83,6 +82,7 @@ from lp.registry.interfaces.person import IPersonSet |
543 | from lp.registry.interfaces.product import IProductSet |
544 | from lp.services.config import config |
545 | from lp.services.database.constants import UTC_NOW |
546 | +from lp.services.database.sqlobject import SQLObjectNotFound |
547 | from lp.services.features.testing import FeatureFixture |
548 | from lp.services.job.interfaces.job import JobStatus |
549 | from lp.services.webapp import canonical_url |
550 | diff --git a/lib/lp/code/model/tests/test_branchmergeproposaljobs.py b/lib/lp/code/model/tests/test_branchmergeproposaljobs.py |
551 | index 8ea42a1..53f293c 100644 |
552 | --- a/lib/lp/code/model/tests/test_branchmergeproposaljobs.py |
553 | +++ b/lib/lp/code/model/tests/test_branchmergeproposaljobs.py |
554 | @@ -14,7 +14,6 @@ from lazr.lifecycle.event import ObjectModifiedEvent |
555 | from lazr.lifecycle.interfaces import IObjectModifiedEvent |
556 | import pytz |
557 | import six |
558 | -from sqlobject import SQLObjectNotFound |
559 | from storm.locals import Select |
560 | from storm.store import Store |
561 | from testtools.matchers import ( |
562 | @@ -60,6 +59,7 @@ from lp.code.model.branchmergeproposaljob import ( |
563 | from lp.code.model.tests.test_diff import DiffTestCase |
564 | from lp.code.subscribers.branchmergeproposal import merge_proposal_modified |
565 | from lp.services.config import config |
566 | +from lp.services.database.sqlobject import SQLObjectNotFound |
567 | from lp.services.features.testing import FeatureFixture |
568 | from lp.services.job.interfaces.job import JobStatus |
569 | from lp.services.job.model.job import Job |
570 | diff --git a/lib/lp/code/model/tests/test_gitrepository.py b/lib/lp/code/model/tests/test_gitrepository.py |
571 | index a832554..e1579ee 100644 |
572 | --- a/lib/lp/code/model/tests/test_gitrepository.py |
573 | +++ b/lib/lp/code/model/tests/test_gitrepository.py |
574 | @@ -22,7 +22,6 @@ from lazr.lifecycle.event import ObjectModifiedEvent |
575 | from pymacaroons import Macaroon |
576 | import pytz |
577 | import six |
578 | -from sqlobject import SQLObjectNotFound |
579 | from storm.exceptions import LostObjectError |
580 | from storm.store import Store |
581 | from testtools.matchers import ( |
582 | @@ -150,6 +149,7 @@ from lp.services.config import config |
583 | from lp.services.database.constants import UTC_NOW |
584 | from lp.services.database.interfaces import IStore |
585 | from lp.services.database.sqlbase import get_transaction_timestamp |
586 | +from lp.services.database.sqlobject import SQLObjectNotFound |
587 | from lp.services.features.testing import FeatureFixture |
588 | from lp.services.identity.interfaces.account import AccountStatus |
589 | from lp.services.job.interfaces.job import JobStatus |
590 | diff --git a/lib/lp/registry/model/distribution.py b/lib/lp/registry/model/distribution.py |
591 | index dada762..4f00e9b 100644 |
592 | --- a/lib/lp/registry/model/distribution.py |
593 | +++ b/lib/lp/registry/model/distribution.py |
594 | @@ -13,12 +13,6 @@ import itertools |
595 | from operator import itemgetter |
596 | |
597 | import six |
598 | -from sqlobject import ( |
599 | - BoolCol, |
600 | - ForeignKey, |
601 | - SQLObjectNotFound, |
602 | - StringCol, |
603 | - ) |
604 | from storm.expr import ( |
605 | And, |
606 | Desc, |
607 | @@ -158,6 +152,12 @@ from lp.services.database.sqlbase import ( |
608 | SQLBase, |
609 | sqlvalues, |
610 | ) |
611 | +from lp.services.database.sqlobject import ( |
612 | + BoolCol, |
613 | + ForeignKey, |
614 | + SQLObjectNotFound, |
615 | + StringCol, |
616 | + ) |
617 | from lp.services.database.stormexpr import ( |
618 | fti_search, |
619 | rank_by_fti, |
620 | diff --git a/lib/lp/registry/model/distributionmirror.py b/lib/lp/registry/model/distributionmirror.py |
621 | index 71d7c49..85e44ba 100644 |
622 | --- a/lib/lp/registry/model/distributionmirror.py |
623 | +++ b/lib/lp/registry/model/distributionmirror.py |
624 | @@ -19,11 +19,6 @@ from datetime import ( |
625 | ) |
626 | |
627 | import pytz |
628 | -from sqlobject import ( |
629 | - BoolCol, |
630 | - ForeignKey, |
631 | - StringCol, |
632 | - ) |
633 | from storm.expr import ( |
634 | And, |
635 | Desc, |
636 | @@ -73,6 +68,11 @@ from lp.services.database.sqlbase import ( |
637 | SQLBase, |
638 | sqlvalues, |
639 | ) |
640 | +from lp.services.database.sqlobject import ( |
641 | + BoolCol, |
642 | + ForeignKey, |
643 | + StringCol, |
644 | + ) |
645 | from lp.services.helpers import shortlist |
646 | from lp.services.mail.helpers import ( |
647 | get_contact_email_addresses, |
648 | diff --git a/lib/lp/registry/model/distroseries.py b/lib/lp/registry/model/distroseries.py |
649 | index e039e45..be223c7 100644 |
650 | --- a/lib/lp/registry/model/distroseries.py |
651 | +++ b/lib/lp/registry/model/distroseries.py |
652 | @@ -20,15 +20,6 @@ from operator import ( |
653 | import apt_pkg |
654 | from lazr.delegates import delegate_to |
655 | import six |
656 | -from sqlobject import ( |
657 | - BoolCol, |
658 | - ForeignKey, |
659 | - IntCol, |
660 | - SQLMultipleJoin, |
661 | - SQLObjectNotFound, |
662 | - SQLRelatedJoin, |
663 | - StringCol, |
664 | - ) |
665 | from storm.expr import ( |
666 | And, |
667 | Column, |
668 | @@ -112,6 +103,15 @@ from lp.services.database.sqlbase import ( |
669 | SQLBase, |
670 | sqlvalues, |
671 | ) |
672 | +from lp.services.database.sqlobject import ( |
673 | + BoolCol, |
674 | + ForeignKey, |
675 | + IntCol, |
676 | + SQLMultipleJoin, |
677 | + SQLObjectNotFound, |
678 | + SQLRelatedJoin, |
679 | + StringCol, |
680 | + ) |
681 | from lp.services.database.stormexpr import ( |
682 | fti_search, |
683 | IsTrue, |
684 | diff --git a/lib/lp/registry/model/distroseriesdifference.py b/lib/lp/registry/model/distroseriesdifference.py |
685 | index 3b3bef4..3d3c55b 100644 |
686 | --- a/lib/lp/registry/model/distroseriesdifference.py |
687 | +++ b/lib/lp/registry/model/distroseriesdifference.py |
688 | @@ -18,7 +18,6 @@ from debian.changelog import ( |
689 | ) |
690 | from lazr.enum import DBItem |
691 | import six |
692 | -from sqlobject import StringCol |
693 | from storm.expr import ( |
694 | And, |
695 | Cast, |
696 | @@ -73,6 +72,7 @@ from lp.services.database.interfaces import ( |
697 | IMasterStore, |
698 | IStore, |
699 | ) |
700 | +from lp.services.database.sqlobject import StringCol |
701 | from lp.services.database.stormbase import StormBase |
702 | from lp.services.messages.model.message import ( |
703 | Message, |
704 | diff --git a/lib/lp/registry/model/gpgkey.py b/lib/lp/registry/model/gpgkey.py |
705 | index 236297c..a786891 100644 |
706 | --- a/lib/lp/registry/model/gpgkey.py |
707 | +++ b/lib/lp/registry/model/gpgkey.py |
708 | @@ -3,12 +3,6 @@ |
709 | |
710 | __all__ = ['GPGKey', 'GPGKeySet'] |
711 | |
712 | -from sqlobject import ( |
713 | - BoolCol, |
714 | - ForeignKey, |
715 | - IntCol, |
716 | - StringCol, |
717 | - ) |
718 | from zope.component import getUtility |
719 | from zope.interface import implementer |
720 | |
721 | @@ -21,6 +15,12 @@ from lp.services.database.sqlbase import ( |
722 | SQLBase, |
723 | sqlvalues, |
724 | ) |
725 | +from lp.services.database.sqlobject import ( |
726 | + BoolCol, |
727 | + ForeignKey, |
728 | + IntCol, |
729 | + StringCol, |
730 | + ) |
731 | from lp.services.gpg.interfaces import ( |
732 | GPGKeyAlgorithm, |
733 | IGPGHandler, |
734 | diff --git a/lib/lp/registry/model/karma.py b/lib/lp/registry/model/karma.py |
735 | index c4d4243..9ff7278 100644 |
736 | --- a/lib/lp/registry/model/karma.py |
737 | +++ b/lib/lp/registry/model/karma.py |
738 | @@ -13,13 +13,6 @@ __all__ = [ |
739 | 'KarmaContextMixin', |
740 | ] |
741 | |
742 | -from sqlobject import ( |
743 | - ForeignKey, |
744 | - IntCol, |
745 | - SQLMultipleJoin, |
746 | - SQLObjectNotFound, |
747 | - StringCol, |
748 | - ) |
749 | from storm.expr import Desc |
750 | from zope.interface import implementer |
751 | |
752 | @@ -45,6 +38,13 @@ from lp.services.database.sqlbase import ( |
753 | SQLBase, |
754 | sqlvalues, |
755 | ) |
756 | +from lp.services.database.sqlobject import ( |
757 | + ForeignKey, |
758 | + IntCol, |
759 | + SQLMultipleJoin, |
760 | + SQLObjectNotFound, |
761 | + StringCol, |
762 | + ) |
763 | |
764 | |
765 | @implementer(IKarmaAssignedEvent) |
766 | diff --git a/lib/lp/registry/model/milestone.py b/lib/lp/registry/model/milestone.py |
767 | index 2172fb9..aaf2106 100644 |
768 | --- a/lib/lp/registry/model/milestone.py |
769 | +++ b/lib/lp/registry/model/milestone.py |
770 | @@ -17,13 +17,6 @@ from operator import itemgetter |
771 | |
772 | from lazr.restful.declarations import error_status |
773 | from six.moves import http_client |
774 | -from sqlobject import ( |
775 | - AND, |
776 | - BoolCol, |
777 | - DateCol, |
778 | - ForeignKey, |
779 | - StringCol, |
780 | - ) |
781 | from storm.expr import ( |
782 | And, |
783 | Desc, |
784 | @@ -60,6 +53,13 @@ from lp.registry.model.productrelease import ProductRelease |
785 | from lp.services.database.decoratedresultset import DecoratedResultSet |
786 | from lp.services.database.interfaces import IStore |
787 | from lp.services.database.sqlbase import SQLBase |
788 | +from lp.services.database.sqlobject import ( |
789 | + AND, |
790 | + BoolCol, |
791 | + DateCol, |
792 | + ForeignKey, |
793 | + StringCol, |
794 | + ) |
795 | from lp.services.propertycache import get_property_cache |
796 | from lp.services.webapp.sorting import expand_numbers |
797 | |
798 | diff --git a/lib/lp/registry/model/packaging.py b/lib/lp/registry/model/packaging.py |
799 | index df6c7b6..9e40e22 100644 |
800 | --- a/lib/lp/registry/model/packaging.py |
801 | +++ b/lib/lp/registry/model/packaging.py |
802 | @@ -7,7 +7,6 @@ from lazr.lifecycle.event import ( |
803 | ObjectCreatedEvent, |
804 | ObjectDeletedEvent, |
805 | ) |
806 | -from sqlobject import ForeignKey |
807 | from zope.component import getUtility |
808 | from zope.event import notify |
809 | from zope.interface import implementer |
810 | @@ -29,6 +28,7 @@ from lp.services.database.constants import ( |
811 | from lp.services.database.datetimecol import UtcDateTimeCol |
812 | from lp.services.database.enumcol import EnumCol |
813 | from lp.services.database.sqlbase import SQLBase |
814 | +from lp.services.database.sqlobject import ForeignKey |
815 | from lp.services.webapp.interfaces import ILaunchBag |
816 | |
817 | |
818 | diff --git a/lib/lp/registry/model/person.py b/lib/lp/registry/model/person.py |
819 | index 708e937..79d793e 100644 |
820 | --- a/lib/lp/registry/model/person.py |
821 | +++ b/lib/lp/registry/model/person.py |
822 | @@ -46,14 +46,6 @@ from lazr.restful.utils import ( |
823 | import pytz |
824 | from requests import PreparedRequest |
825 | import six |
826 | -from sqlobject import ( |
827 | - BoolCol, |
828 | - ForeignKey, |
829 | - IntCol, |
830 | - SQLMultipleJoin, |
831 | - SQLObjectNotFound, |
832 | - StringCol, |
833 | - ) |
834 | from storm.base import Storm |
835 | from storm.expr import ( |
836 | Alias, |
837 | @@ -267,6 +259,14 @@ from lp.services.database.sqlbase import ( |
838 | SQLBase, |
839 | sqlvalues, |
840 | ) |
841 | +from lp.services.database.sqlobject import ( |
842 | + BoolCol, |
843 | + ForeignKey, |
844 | + IntCol, |
845 | + SQLMultipleJoin, |
846 | + SQLObjectNotFound, |
847 | + StringCol, |
848 | + ) |
849 | from lp.services.database.stormbase import StormBase |
850 | from lp.services.database.stormexpr import fti_search |
851 | from lp.services.helpers import ( |
852 | diff --git a/lib/lp/registry/model/pillar.py b/lib/lp/registry/model/pillar.py |
853 | index 7edf34e..65ad11a 100644 |
854 | --- a/lib/lp/registry/model/pillar.py |
855 | +++ b/lib/lp/registry/model/pillar.py |
856 | @@ -10,11 +10,6 @@ from operator import attrgetter |
857 | import warnings |
858 | |
859 | import six |
860 | -from sqlobject import ( |
861 | - BoolCol, |
862 | - ForeignKey, |
863 | - StringCol, |
864 | - ) |
865 | from storm.databases.postgres import Case |
866 | from storm.expr import ( |
867 | And, |
868 | @@ -54,6 +49,11 @@ from lp.services.database.bulk import load_related |
869 | from lp.services.database.decoratedresultset import DecoratedResultSet |
870 | from lp.services.database.interfaces import IStore |
871 | from lp.services.database.sqlbase import SQLBase |
872 | +from lp.services.database.sqlobject import ( |
873 | + BoolCol, |
874 | + ForeignKey, |
875 | + StringCol, |
876 | + ) |
877 | from lp.services.database.stormexpr import ( |
878 | fti_search, |
879 | rank_by_fti, |
880 | diff --git a/lib/lp/registry/model/product.py b/lib/lp/registry/model/product.py |
881 | index b539782..49e591b 100644 |
882 | --- a/lib/lp/registry/model/product.py |
883 | +++ b/lib/lp/registry/model/product.py |
884 | @@ -20,13 +20,6 @@ from lazr.restful.declarations import error_status |
885 | from lazr.restful.utils import safe_hasattr |
886 | import pytz |
887 | from six.moves import http_client |
888 | -from sqlobject import ( |
889 | - BoolCol, |
890 | - ForeignKey, |
891 | - SQLMultipleJoin, |
892 | - SQLObjectNotFound, |
893 | - StringCol, |
894 | - ) |
895 | from storm.expr import ( |
896 | And, |
897 | Coalesce, |
898 | @@ -192,6 +185,13 @@ from lp.services.database.sqlbase import ( |
899 | SQLBase, |
900 | sqlvalues, |
901 | ) |
902 | +from lp.services.database.sqlobject import ( |
903 | + BoolCol, |
904 | + ForeignKey, |
905 | + SQLMultipleJoin, |
906 | + SQLObjectNotFound, |
907 | + StringCol, |
908 | + ) |
909 | from lp.services.database.stormexpr import ( |
910 | ArrayAgg, |
911 | ArrayIntersects, |
912 | diff --git a/lib/lp/registry/model/productlicense.py b/lib/lp/registry/model/productlicense.py |
913 | index 35c905d..726808d 100644 |
914 | --- a/lib/lp/registry/model/productlicense.py |
915 | +++ b/lib/lp/registry/model/productlicense.py |
916 | @@ -8,13 +8,13 @@ __all__ = [ |
917 | ] |
918 | |
919 | |
920 | -from sqlobject import ForeignKey |
921 | from zope.interface import implementer |
922 | |
923 | from lp.registry.interfaces.product import License |
924 | from lp.registry.interfaces.productlicense import IProductLicense |
925 | from lp.services.database.enumcol import EnumCol |
926 | from lp.services.database.sqlbase import SQLBase |
927 | +from lp.services.database.sqlobject import ForeignKey |
928 | |
929 | |
930 | @implementer(IProductLicense) |
931 | diff --git a/lib/lp/registry/model/productrelease.py b/lib/lp/registry/model/productrelease.py |
932 | index f1e0744..14394c5 100644 |
933 | --- a/lib/lp/registry/model/productrelease.py |
934 | +++ b/lib/lp/registry/model/productrelease.py |
935 | @@ -14,11 +14,6 @@ from io import ( |
936 | ) |
937 | import os |
938 | |
939 | -from sqlobject import ( |
940 | - ForeignKey, |
941 | - SQLMultipleJoin, |
942 | - StringCol, |
943 | - ) |
944 | from storm.expr import ( |
945 | And, |
946 | Desc, |
947 | @@ -51,6 +46,11 @@ from lp.services.database.sqlbase import ( |
948 | SQLBase, |
949 | sqlvalues, |
950 | ) |
951 | +from lp.services.database.sqlobject import ( |
952 | + ForeignKey, |
953 | + SQLMultipleJoin, |
954 | + StringCol, |
955 | + ) |
956 | from lp.services.librarian.interfaces import ILibraryFileAliasSet |
957 | from lp.services.propertycache import cachedproperty |
958 | from lp.services.webapp.publisher import ( |
959 | diff --git a/lib/lp/registry/model/productseries.py b/lib/lp/registry/model/productseries.py |
960 | index 0cb2be2..4cfbda8 100644 |
961 | --- a/lib/lp/registry/model/productseries.py |
962 | +++ b/lib/lp/registry/model/productseries.py |
963 | @@ -12,12 +12,6 @@ __all__ = [ |
964 | import datetime |
965 | |
966 | from lazr.delegates import delegate_to |
967 | -from sqlobject import ( |
968 | - ForeignKey, |
969 | - SQLMultipleJoin, |
970 | - SQLObjectNotFound, |
971 | - StringCol, |
972 | - ) |
973 | from storm.expr import ( |
974 | Max, |
975 | Sum, |
976 | @@ -72,6 +66,12 @@ from lp.services.database.decoratedresultset import DecoratedResultSet |
977 | from lp.services.database.enumcol import EnumCol |
978 | from lp.services.database.interfaces import IStore |
979 | from lp.services.database.sqlbase import SQLBase |
980 | +from lp.services.database.sqlobject import ( |
981 | + ForeignKey, |
982 | + SQLMultipleJoin, |
983 | + SQLObjectNotFound, |
984 | + StringCol, |
985 | + ) |
986 | from lp.services.propertycache import cachedproperty |
987 | from lp.services.webapp.publisher import canonical_url |
988 | from lp.services.webapp.sorting import sorted_dotted_numbers |
989 | diff --git a/lib/lp/registry/model/projectgroup.py b/lib/lp/registry/model/projectgroup.py |
990 | index 7c645d8..ad1b010 100644 |
991 | --- a/lib/lp/registry/model/projectgroup.py |
992 | +++ b/lib/lp/registry/model/projectgroup.py |
993 | @@ -10,13 +10,6 @@ __all__ = [ |
994 | ] |
995 | |
996 | import six |
997 | -from sqlobject import ( |
998 | - AND, |
999 | - BoolCol, |
1000 | - ForeignKey, |
1001 | - SQLObjectNotFound, |
1002 | - StringCol, |
1003 | - ) |
1004 | from storm.expr import ( |
1005 | And, |
1006 | In, |
1007 | @@ -100,6 +93,13 @@ from lp.services.database.sqlbase import ( |
1008 | SQLBase, |
1009 | sqlvalues, |
1010 | ) |
1011 | +from lp.services.database.sqlobject import ( |
1012 | + AND, |
1013 | + BoolCol, |
1014 | + ForeignKey, |
1015 | + SQLObjectNotFound, |
1016 | + StringCol, |
1017 | + ) |
1018 | from lp.services.database.stormexpr import fti_search |
1019 | from lp.services.helpers import shortlist |
1020 | from lp.services.propertycache import cachedproperty |
1021 | diff --git a/lib/lp/registry/model/series.py b/lib/lp/registry/model/series.py |
1022 | index 0754811..721c113 100644 |
1023 | --- a/lib/lp/registry/model/series.py |
1024 | +++ b/lib/lp/registry/model/series.py |
1025 | @@ -10,7 +10,6 @@ __all__ = [ |
1026 | |
1027 | from operator import attrgetter |
1028 | |
1029 | -from sqlobject import StringCol |
1030 | from zope.interface import implementer |
1031 | |
1032 | from lp.registry.interfaces.series import ( |
1033 | @@ -18,6 +17,7 @@ from lp.registry.interfaces.series import ( |
1034 | SeriesStatus, |
1035 | ) |
1036 | from lp.registry.model.hasdrivers import HasDriversMixin |
1037 | +from lp.services.database.sqlobject import StringCol |
1038 | |
1039 | |
1040 | ACTIVE_STATUSES = [ |
1041 | diff --git a/lib/lp/registry/model/sharingjob.py b/lib/lp/registry/model/sharingjob.py |
1042 | index a8bc41a..10fe2e3 100644 |
1043 | --- a/lib/lp/registry/model/sharingjob.py |
1044 | +++ b/lib/lp/registry/model/sharingjob.py |
1045 | @@ -16,7 +16,6 @@ from lazr.enum import ( |
1046 | ) |
1047 | import simplejson |
1048 | import six |
1049 | -from sqlobject import SQLObjectNotFound |
1050 | from storm.expr import ( |
1051 | And, |
1052 | In, |
1053 | @@ -88,6 +87,7 @@ from lp.registry.model.teammembership import TeamParticipation |
1054 | from lp.services.config import config |
1055 | from lp.services.database.enumcol import EnumCol |
1056 | from lp.services.database.interfaces import IStore |
1057 | +from lp.services.database.sqlobject import SQLObjectNotFound |
1058 | from lp.services.database.stormbase import StormBase |
1059 | from lp.services.job.model.job import ( |
1060 | EnumeratedSubclass, |
1061 | diff --git a/lib/lp/registry/model/sourcepackagename.py b/lib/lp/registry/model/sourcepackagename.py |
1062 | index e91e5f2..8f1720c 100644 |
1063 | --- a/lib/lp/registry/model/sourcepackagename.py |
1064 | +++ b/lib/lp/registry/model/sourcepackagename.py |
1065 | @@ -8,11 +8,6 @@ __all__ = [ |
1066 | ] |
1067 | |
1068 | import six |
1069 | -from sqlobject import ( |
1070 | - SQLMultipleJoin, |
1071 | - SQLObjectNotFound, |
1072 | - StringCol, |
1073 | - ) |
1074 | from zope.interface import implementer |
1075 | |
1076 | from lp.app.errors import NotFoundError |
1077 | @@ -30,6 +25,11 @@ from lp.services.database.sqlbase import ( |
1078 | SQLBase, |
1079 | sqlvalues, |
1080 | ) |
1081 | +from lp.services.database.sqlobject import ( |
1082 | + SQLMultipleJoin, |
1083 | + SQLObjectNotFound, |
1084 | + StringCol, |
1085 | + ) |
1086 | |
1087 | |
1088 | @six.python_2_unicode_compatible |
1089 | diff --git a/lib/lp/registry/model/teammembership.py b/lib/lp/registry/model/teammembership.py |
1090 | index f40ec14..3d5f53f 100644 |
1091 | --- a/lib/lp/registry/model/teammembership.py |
1092 | +++ b/lib/lp/registry/model/teammembership.py |
1093 | @@ -14,10 +14,6 @@ from datetime import ( |
1094 | ) |
1095 | |
1096 | import pytz |
1097 | -from sqlobject import ( |
1098 | - ForeignKey, |
1099 | - StringCol, |
1100 | - ) |
1101 | from storm.info import ClassAlias |
1102 | from storm.store import Store |
1103 | from zope.component import getUtility |
1104 | @@ -61,6 +57,10 @@ from lp.services.database.sqlbase import ( |
1105 | SQLBase, |
1106 | sqlvalues, |
1107 | ) |
1108 | +from lp.services.database.sqlobject import ( |
1109 | + ForeignKey, |
1110 | + StringCol, |
1111 | + ) |
1112 | |
1113 | |
1114 | @implementer(ITeamMembership) |
1115 | diff --git a/lib/lp/registry/tests/test_distributionmirror_prober.py b/lib/lp/registry/tests/test_distributionmirror_prober.py |
1116 | index 0648923..539ae7b 100644 |
1117 | --- a/lib/lp/registry/tests/test_distributionmirror_prober.py |
1118 | +++ b/lib/lp/registry/tests/test_distributionmirror_prober.py |
1119 | @@ -14,7 +14,6 @@ from lazr.uri import URI |
1120 | import responses |
1121 | import six |
1122 | from six.moves import http_client |
1123 | -from sqlobject import SQLObjectNotFound |
1124 | from testtools.matchers import ( |
1125 | ContainsDict, |
1126 | Equals, |
1127 | @@ -84,6 +83,7 @@ from lp.registry.tests.distributionmirror_http_server import ( |
1128 | from lp.services.config import config |
1129 | from lp.services.daemons.tachandler import TacTestSetup |
1130 | from lp.services.database.interfaces import IStore |
1131 | +from lp.services.database.sqlobject import SQLObjectNotFound |
1132 | from lp.services.httpproxy.connect_tunneling import TunnelingAgent |
1133 | from lp.services.timeout import default_timeout |
1134 | from lp.testing import ( |
1135 | diff --git a/lib/lp/registry/vocabularies.py b/lib/lp/registry/vocabularies.py |
1136 | index 9adfe8d..9712f96 100644 |
1137 | --- a/lib/lp/registry/vocabularies.py |
1138 | +++ b/lib/lp/registry/vocabularies.py |
1139 | @@ -65,11 +65,6 @@ import re |
1140 | |
1141 | from lazr.restful.interfaces import IReference |
1142 | import six |
1143 | -from sqlobject import ( |
1144 | - AND, |
1145 | - CONTAINSSTRING, |
1146 | - OR, |
1147 | - ) |
1148 | from storm.databases.postgres import Case |
1149 | from storm.expr import ( |
1150 | And, |
1151 | @@ -178,6 +173,11 @@ from lp.services.database.sqlbase import ( |
1152 | SQLBase, |
1153 | sqlvalues, |
1154 | ) |
1155 | +from lp.services.database.sqlobject import ( |
1156 | + AND, |
1157 | + CONTAINSSTRING, |
1158 | + OR, |
1159 | + ) |
1160 | from lp.services.database.stormexpr import ( |
1161 | fti_search, |
1162 | rank_by_fti, |
1163 | diff --git a/lib/lp/services/database/sqlbase.py b/lib/lp/services/database/sqlbase.py |
1164 | index 9ee105c..0d3f51d 100644 |
1165 | --- a/lib/lp/services/database/sqlbase.py |
1166 | +++ b/lib/lp/services/database/sqlbase.py |
1167 | @@ -37,7 +37,6 @@ from psycopg2.extensions import ( |
1168 | ISOLATION_LEVEL_SERIALIZABLE, |
1169 | ) |
1170 | import pytz |
1171 | -from sqlobject.sqlbuilder import sqlrepr |
1172 | import storm |
1173 | from storm.databases.postgres import compile as postgres_compile |
1174 | from storm.expr import ( |
1175 | @@ -66,6 +65,7 @@ from lp.services.database.interfaces import ( |
1176 | IStoreSelector, |
1177 | MAIN_STORE, |
1178 | ) |
1179 | +from lp.services.database.sqlobject import sqlrepr |
1180 | from lp.services.propertycache import clear_property_cache |
1181 | |
1182 | |
1183 | diff --git a/lib/sqlobject/__init__.py b/lib/lp/services/database/sqlobject/__init__.py |
1184 | similarity index 95% |
1185 | rename from lib/sqlobject/__init__.py |
1186 | rename to lib/lp/services/database/sqlobject/__init__.py |
1187 | index 422a8d1..a30b27d 100644 |
1188 | --- a/lib/sqlobject/__init__.py |
1189 | +++ b/lib/lp/services/database/sqlobject/__init__.py |
1190 | @@ -5,18 +5,12 @@ |
1191 | |
1192 | # SKIP this file when reformatting, due to the sys mangling. |
1193 | import datetime |
1194 | -import sys |
1195 | |
1196 | import six |
1197 | from storm.expr import SQL |
1198 | from storm.sqlobject import * # noqa: F401,F403 |
1199 | |
1200 | |
1201 | -# Provide the same interface from these other locations. |
1202 | -sys.modules['sqlobject.joins'] = sys.modules['sqlobject'] |
1203 | -sys.modules['sqlobject.sqlbuilder'] = sys.modules['sqlobject'] |
1204 | -del sys |
1205 | - |
1206 | _sqlStringReplace = [ |
1207 | ('\\', '\\\\'), |
1208 | ("'", "''"), |
1209 | diff --git a/lib/lp/services/identity/model/account.py b/lib/lp/services/identity/model/account.py |
1210 | index 26a0c4c..32bfddc 100644 |
1211 | --- a/lib/lp/services/identity/model/account.py |
1212 | +++ b/lib/lp/services/identity/model/account.py |
1213 | @@ -11,7 +11,6 @@ __all__ = [ |
1214 | import datetime |
1215 | |
1216 | import six |
1217 | -from sqlobject import StringCol |
1218 | from storm.locals import ReferenceSet |
1219 | from zope.interface import implementer |
1220 | |
1221 | @@ -23,6 +22,7 @@ from lp.services.database.interfaces import ( |
1222 | IStore, |
1223 | ) |
1224 | from lp.services.database.sqlbase import SQLBase |
1225 | +from lp.services.database.sqlobject import StringCol |
1226 | from lp.services.helpers import backslashreplace |
1227 | from lp.services.identity.interfaces.account import ( |
1228 | AccountCreationRationale, |
1229 | diff --git a/lib/lp/services/identity/model/emailaddress.py b/lib/lp/services/identity/model/emailaddress.py |
1230 | index 08b48d9..87afe14 100644 |
1231 | --- a/lib/lp/services/identity/model/emailaddress.py |
1232 | +++ b/lib/lp/services/identity/model/emailaddress.py |
1233 | @@ -13,10 +13,6 @@ import hashlib |
1234 | import operator |
1235 | |
1236 | import six |
1237 | -from sqlobject import ( |
1238 | - ForeignKey, |
1239 | - StringCol, |
1240 | - ) |
1241 | from storm.expr import Lower |
1242 | from zope.interface import implementer |
1243 | |
1244 | @@ -30,6 +26,10 @@ from lp.services.database.sqlbase import ( |
1245 | SQLBase, |
1246 | sqlvalues, |
1247 | ) |
1248 | +from lp.services.database.sqlobject import ( |
1249 | + ForeignKey, |
1250 | + StringCol, |
1251 | + ) |
1252 | from lp.services.identity.interfaces.emailaddress import ( |
1253 | EmailAddressAlreadyTaken, |
1254 | EmailAddressStatus, |
1255 | diff --git a/lib/lp/services/job/model/job.py b/lib/lp/services/job/model/job.py |
1256 | index f5977e0..f35a858 100644 |
1257 | --- a/lib/lp/services/job/model/job.py |
1258 | +++ b/lib/lp/services/job/model/job.py |
1259 | @@ -17,7 +17,6 @@ import time |
1260 | |
1261 | from lazr.jobrunner.jobrunner import LeaseHeld |
1262 | import pytz |
1263 | -from sqlobject import StringCol |
1264 | from storm.expr import ( |
1265 | And, |
1266 | Or, |
1267 | @@ -37,6 +36,7 @@ from lp.services.database.datetimecol import UtcDateTimeCol |
1268 | from lp.services.database.enumcol import EnumCol |
1269 | from lp.services.database.interfaces import IStore |
1270 | from lp.services.database.sqlbase import SQLBase |
1271 | +from lp.services.database.sqlobject import StringCol |
1272 | from lp.services.job.interfaces.job import ( |
1273 | IJob, |
1274 | JobStatus, |
1275 | diff --git a/lib/lp/services/librarian/client.py b/lib/lp/services/librarian/client.py |
1276 | index 0dc0c61..434e2f2 100644 |
1277 | --- a/lib/lp/services/librarian/client.py |
1278 | +++ b/lib/lp/services/librarian/client.py |
1279 | @@ -35,7 +35,6 @@ from six.moves.urllib.parse import ( |
1280 | urlunparse, |
1281 | ) |
1282 | from six.moves.urllib.request import urlopen |
1283 | -from sqlobject import SQLObjectNotFound |
1284 | from storm.store import Store |
1285 | from zope.interface import implementer |
1286 | |
1287 | @@ -45,6 +44,7 @@ from lp.services.config import ( |
1288 | ) |
1289 | from lp.services.database.interfaces import IMasterStore |
1290 | from lp.services.database.postgresql import ConnectionString |
1291 | +from lp.services.database.sqlobject import SQLObjectNotFound |
1292 | from lp.services.librarian.interfaces.client import ( |
1293 | DownloadFailed, |
1294 | ILibrarianClient, |
1295 | diff --git a/lib/lp/services/librarian/model.py b/lib/lp/services/librarian/model.py |
1296 | index 05cd4ba..3e730eb 100644 |
1297 | --- a/lib/lp/services/librarian/model.py |
1298 | +++ b/lib/lp/services/librarian/model.py |
1299 | @@ -17,13 +17,6 @@ from lazr.delegates import delegate_to |
1300 | import pytz |
1301 | import six |
1302 | from six.moves.urllib.parse import urlparse |
1303 | -from sqlobject import ( |
1304 | - BoolCol, |
1305 | - ForeignKey, |
1306 | - IntCol, |
1307 | - SQLRelatedJoin, |
1308 | - StringCol, |
1309 | - ) |
1310 | from storm.locals import ( |
1311 | Date, |
1312 | Desc, |
1313 | @@ -52,6 +45,13 @@ from lp.services.database.sqlbase import ( |
1314 | session_store, |
1315 | SQLBase, |
1316 | ) |
1317 | +from lp.services.database.sqlobject import ( |
1318 | + BoolCol, |
1319 | + ForeignKey, |
1320 | + IntCol, |
1321 | + SQLRelatedJoin, |
1322 | + StringCol, |
1323 | + ) |
1324 | from lp.services.database.stormbase import StormBase |
1325 | from lp.services.librarian.interfaces import ( |
1326 | ILibraryFileAlias, |
1327 | diff --git a/lib/lp/services/librarianserver/tests/test_gc.py b/lib/lp/services/librarianserver/tests/test_gc.py |
1328 | index ecad31c..ca2e57e 100644 |
1329 | --- a/lib/lp/services/librarianserver/tests/test_gc.py |
1330 | +++ b/lib/lp/services/librarianserver/tests/test_gc.py |
1331 | @@ -24,7 +24,6 @@ from fixtures import MockPatchObject |
1332 | import pytz |
1333 | import requests |
1334 | from six.moves.urllib.parse import urljoin |
1335 | -from sqlobject import SQLObjectNotFound |
1336 | from storm.store import Store |
1337 | from swiftclient import client as swiftclient |
1338 | from testtools.matchers import ( |
1339 | @@ -40,6 +39,7 @@ from lp.services.database.sqlbase import ( |
1340 | cursor, |
1341 | ISOLATION_LEVEL_AUTOCOMMIT, |
1342 | ) |
1343 | +from lp.services.database.sqlobject import SQLObjectNotFound |
1344 | from lp.services.features.testing import FeatureFixture |
1345 | from lp.services.librarian.client import LibrarianClient |
1346 | from lp.services.librarian.model import ( |
1347 | diff --git a/lib/lp/services/messages/model/message.py b/lib/lp/services/messages/model/message.py |
1348 | index a3af270..53f4ee2 100644 |
1349 | --- a/lib/lp/services/messages/model/message.py |
1350 | +++ b/lib/lp/services/messages/model/message.py |
1351 | @@ -29,14 +29,6 @@ import os.path |
1352 | from lazr.config import as_timedelta |
1353 | import pytz |
1354 | import six |
1355 | -from sqlobject import ( |
1356 | - BoolCol, |
1357 | - ForeignKey, |
1358 | - IntCol, |
1359 | - SQLMultipleJoin, |
1360 | - SQLRelatedJoin, |
1361 | - StringCol, |
1362 | - ) |
1363 | from storm.locals import ( |
1364 | And, |
1365 | DateTime, |
1366 | @@ -61,6 +53,14 @@ from lp.services.config import config |
1367 | from lp.services.database.constants import UTC_NOW |
1368 | from lp.services.database.datetimecol import UtcDateTimeCol |
1369 | from lp.services.database.sqlbase import SQLBase |
1370 | +from lp.services.database.sqlobject import ( |
1371 | + BoolCol, |
1372 | + ForeignKey, |
1373 | + IntCol, |
1374 | + SQLMultipleJoin, |
1375 | + SQLRelatedJoin, |
1376 | + StringCol, |
1377 | + ) |
1378 | from lp.services.librarian.interfaces import ILibraryFileAliasSet |
1379 | from lp.services.messages.interfaces.message import ( |
1380 | IDirectEmailAuthorization, |
1381 | diff --git a/lib/lp/services/statistics/model/statistics.py b/lib/lp/services/statistics/model/statistics.py |
1382 | index fcc6ae9..6170e56 100644 |
1383 | --- a/lib/lp/services/statistics/model/statistics.py |
1384 | +++ b/lib/lp/services/statistics/model/statistics.py |
1385 | @@ -8,10 +8,6 @@ __all__ = [ |
1386 | 'LaunchpadStatisticSet', |
1387 | ] |
1388 | |
1389 | -from sqlobject import ( |
1390 | - IntCol, |
1391 | - StringCol, |
1392 | - ) |
1393 | from zope.component import getUtility |
1394 | from zope.interface import implementer |
1395 | |
1396 | @@ -32,6 +28,10 @@ from lp.services.database.sqlbase import ( |
1397 | cursor, |
1398 | SQLBase, |
1399 | ) |
1400 | +from lp.services.database.sqlobject import ( |
1401 | + IntCol, |
1402 | + StringCol, |
1403 | + ) |
1404 | from lp.services.statistics.interfaces.statistic import ( |
1405 | ILaunchpadStatistic, |
1406 | ILaunchpadStatisticSet, |
1407 | diff --git a/lib/lp/services/verification/model/logintoken.py b/lib/lp/services/verification/model/logintoken.py |
1408 | index 6ceca6a..ca24bf8 100644 |
1409 | --- a/lib/lp/services/verification/model/logintoken.py |
1410 | +++ b/lib/lp/services/verification/model/logintoken.py |
1411 | @@ -10,11 +10,6 @@ import hashlib |
1412 | |
1413 | import pytz |
1414 | import six |
1415 | -from sqlobject import ( |
1416 | - ForeignKey, |
1417 | - SQLObjectNotFound, |
1418 | - StringCol, |
1419 | - ) |
1420 | from storm.expr import And |
1421 | from zope.component import getUtility |
1422 | from zope.interface import implementer |
1423 | @@ -35,6 +30,11 @@ from lp.services.database.sqlbase import ( |
1424 | SQLBase, |
1425 | sqlvalues, |
1426 | ) |
1427 | +from lp.services.database.sqlobject import ( |
1428 | + ForeignKey, |
1429 | + SQLObjectNotFound, |
1430 | + StringCol, |
1431 | + ) |
1432 | from lp.services.gpg.interfaces import IGPGHandler |
1433 | from lp.services.mail.helpers import get_email_template |
1434 | from lp.services.mail.sendmail import ( |
1435 | diff --git a/lib/lp/services/webapp/vocabulary.py b/lib/lp/services/webapp/vocabulary.py |
1436 | index 9869535..d663e85 100644 |
1437 | --- a/lib/lp/services/webapp/vocabulary.py |
1438 | +++ b/lib/lp/services/webapp/vocabulary.py |
1439 | @@ -25,10 +25,6 @@ from collections import namedtuple |
1440 | |
1441 | from lazr.restful.utils import safe_hasattr |
1442 | import six |
1443 | -from sqlobject import ( |
1444 | - AND, |
1445 | - CONTAINSSTRING, |
1446 | - ) |
1447 | from storm.base import Storm |
1448 | from storm.store import EmptyResultSet |
1449 | from zope.interface import ( |
1450 | @@ -48,6 +44,10 @@ from zope.security.proxy import isinstance as zisinstance |
1451 | |
1452 | from lp.services.database.interfaces import IStore |
1453 | from lp.services.database.sqlbase import SQLBase |
1454 | +from lp.services.database.sqlobject import ( |
1455 | + AND, |
1456 | + CONTAINSSTRING, |
1457 | + ) |
1458 | |
1459 | |
1460 | class ForgivingSimpleVocabulary(SimpleVocabulary): |
1461 | diff --git a/lib/lp/services/worlddata/model/country.py b/lib/lp/services/worlddata/model/country.py |
1462 | index 32006a8..fa21dfb 100644 |
1463 | --- a/lib/lp/services/worlddata/model/country.py |
1464 | +++ b/lib/lp/services/worlddata/model/country.py |
1465 | @@ -4,17 +4,17 @@ |
1466 | __all__ = ['Country', 'CountrySet', 'Continent'] |
1467 | |
1468 | import six |
1469 | -from sqlobject import ( |
1470 | - ForeignKey, |
1471 | - SQLRelatedJoin, |
1472 | - StringCol, |
1473 | - ) |
1474 | from zope.interface import implementer |
1475 | |
1476 | from lp.app.errors import NotFoundError |
1477 | from lp.services.database.constants import DEFAULT |
1478 | from lp.services.database.interfaces import IStore |
1479 | from lp.services.database.sqlbase import SQLBase |
1480 | +from lp.services.database.sqlobject import ( |
1481 | + ForeignKey, |
1482 | + SQLRelatedJoin, |
1483 | + StringCol, |
1484 | + ) |
1485 | from lp.services.worlddata.interfaces.country import ( |
1486 | IContinent, |
1487 | ICountry, |
1488 | diff --git a/lib/lp/services/worlddata/model/language.py b/lib/lp/services/worlddata/model/language.py |
1489 | index 2682190..ba9cf55 100644 |
1490 | --- a/lib/lp/services/worlddata/model/language.py |
1491 | +++ b/lib/lp/services/worlddata/model/language.py |
1492 | @@ -8,13 +8,6 @@ __all__ = [ |
1493 | ] |
1494 | |
1495 | import six |
1496 | -from sqlobject import ( |
1497 | - BoolCol, |
1498 | - IntCol, |
1499 | - SQLObjectNotFound, |
1500 | - SQLRelatedJoin, |
1501 | - StringCol, |
1502 | - ) |
1503 | from storm.expr import ( |
1504 | And, |
1505 | Count, |
1506 | @@ -37,6 +30,13 @@ from lp.services.database.interfaces import ( |
1507 | IStore, |
1508 | ) |
1509 | from lp.services.database.sqlbase import SQLBase |
1510 | +from lp.services.database.sqlobject import ( |
1511 | + BoolCol, |
1512 | + IntCol, |
1513 | + SQLObjectNotFound, |
1514 | + SQLRelatedJoin, |
1515 | + StringCol, |
1516 | + ) |
1517 | from lp.services.propertycache import ( |
1518 | cachedproperty, |
1519 | get_property_cache, |
1520 | diff --git a/lib/lp/services/worlddata/model/spokenin.py b/lib/lp/services/worlddata/model/spokenin.py |
1521 | index 1d75dbb..46e166a 100644 |
1522 | --- a/lib/lp/services/worlddata/model/spokenin.py |
1523 | +++ b/lib/lp/services/worlddata/model/spokenin.py |
1524 | @@ -3,10 +3,10 @@ |
1525 | |
1526 | __all__ = ['SpokenIn'] |
1527 | |
1528 | -from sqlobject import ForeignKey |
1529 | from zope.interface import implementer |
1530 | |
1531 | from lp.services.database.sqlbase import SQLBase |
1532 | +from lp.services.database.sqlobject import ForeignKey |
1533 | from lp.services.worlddata.interfaces.spokenin import ISpokenIn |
1534 | |
1535 | |
1536 | diff --git a/lib/lp/snappy/browser/snapbase.py b/lib/lp/snappy/browser/snapbase.py |
1537 | index 144963f..3bd070a 100644 |
1538 | --- a/lib/lp/snappy/browser/snapbase.py |
1539 | +++ b/lib/lp/snappy/browser/snapbase.py |
1540 | @@ -8,9 +8,9 @@ __all__ = [ |
1541 | "SnapBaseSetNavigation", |
1542 | ] |
1543 | |
1544 | -from sqlobject import SQLObjectNotFound |
1545 | from zope.component import getUtility |
1546 | |
1547 | +from lp.services.database.sqlobject import SQLObjectNotFound |
1548 | from lp.services.webapp import ( |
1549 | GetitemNavigation, |
1550 | Navigation, |
1551 | diff --git a/lib/lp/soyuz/browser/archive.py b/lib/lp/soyuz/browser/archive.py |
1552 | index 5aadc23..05066a0 100644 |
1553 | --- a/lib/lp/soyuz/browser/archive.py |
1554 | +++ b/lib/lp/soyuz/browser/archive.py |
1555 | @@ -34,7 +34,6 @@ from operator import attrgetter |
1556 | |
1557 | from lazr.restful.utils import smartquote |
1558 | import pytz |
1559 | -from sqlobject import SQLObjectNotFound |
1560 | from storm.expr import Desc |
1561 | from zope.component import getUtility |
1562 | from zope.formlib import form |
1563 | @@ -94,6 +93,7 @@ from lp.services.browser_helpers import ( |
1564 | get_user_agent_distroseries, |
1565 | ) |
1566 | from lp.services.database.bulk import load_related |
1567 | +from lp.services.database.sqlobject import SQLObjectNotFound |
1568 | from lp.services.helpers import english_list |
1569 | from lp.services.job.model.job import Job |
1570 | from lp.services.librarian.browser import ( |
1571 | diff --git a/lib/lp/soyuz/doc/gina.txt b/lib/lp/soyuz/doc/gina.txt |
1572 | index 4cecccf..94bc0df 100644 |
1573 | --- a/lib/lp/soyuz/doc/gina.txt |
1574 | +++ b/lib/lp/soyuz/doc/gina.txt |
1575 | @@ -489,7 +489,7 @@ Ensure only one Kamion was created (he's an uploader on multiple packages), |
1576 | and that we imported exactly 9 people (13 packages with 3 being uploaded by |
1577 | Kamion, 2 being uploaded by mdz and 2 by doko). |
1578 | |
1579 | - >>> from sqlobject import LIKE |
1580 | + >>> from lp.services.database.sqlobject import LIKE |
1581 | >>> p = Person.selectOne(LIKE(Person.q.name, u"cjwatson%")) |
1582 | >>> print(p.name) |
1583 | cjwatson |
1584 | diff --git a/lib/lp/soyuz/model/archive.py b/lib/lp/soyuz/model/archive.py |
1585 | index 3888a05..6da89d1 100644 |
1586 | --- a/lib/lp/soyuz/model/archive.py |
1587 | +++ b/lib/lp/soyuz/model/archive.py |
1588 | @@ -16,12 +16,6 @@ import re |
1589 | |
1590 | from lazr.lifecycle.event import ObjectCreatedEvent |
1591 | import six |
1592 | -from sqlobject import ( |
1593 | - BoolCol, |
1594 | - ForeignKey, |
1595 | - IntCol, |
1596 | - StringCol, |
1597 | - ) |
1598 | from storm.base import Storm |
1599 | from storm.expr import ( |
1600 | And, |
1601 | @@ -119,6 +113,12 @@ from lp.services.database.sqlbase import ( |
1602 | SQLBase, |
1603 | sqlvalues, |
1604 | ) |
1605 | +from lp.services.database.sqlobject import ( |
1606 | + BoolCol, |
1607 | + ForeignKey, |
1608 | + IntCol, |
1609 | + StringCol, |
1610 | + ) |
1611 | from lp.services.database.stormexpr import BulkUpdate |
1612 | from lp.services.features import getFeatureFlag |
1613 | from lp.services.gpg.interfaces import IGPGHandler |
1614 | diff --git a/lib/lp/soyuz/model/binarypackagebuild.py b/lib/lp/soyuz/model/binarypackagebuild.py |
1615 | index 5975da3..330a1e3 100644 |
1616 | --- a/lib/lp/soyuz/model/binarypackagebuild.py |
1617 | +++ b/lib/lp/soyuz/model/binarypackagebuild.py |
1618 | @@ -22,7 +22,6 @@ import apt_pkg |
1619 | from debian.deb822 import PkgRelation |
1620 | import pytz |
1621 | import six |
1622 | -from sqlobject import SQLObjectNotFound |
1623 | from storm.expr import ( |
1624 | And, |
1625 | Desc, |
1626 | @@ -76,6 +75,7 @@ from lp.services.database.sqlbase import ( |
1627 | SQLBase, |
1628 | sqlvalues, |
1629 | ) |
1630 | +from lp.services.database.sqlobject import SQLObjectNotFound |
1631 | from lp.services.librarian.browser import ProxiedLibraryFileAlias |
1632 | from lp.services.librarian.interfaces import ILibraryFileAlias |
1633 | from lp.services.librarian.model import ( |
1634 | diff --git a/lib/lp/soyuz/model/binarypackagename.py b/lib/lp/soyuz/model/binarypackagename.py |
1635 | index d8eb09c..90a7cae 100644 |
1636 | --- a/lib/lp/soyuz/model/binarypackagename.py |
1637 | +++ b/lib/lp/soyuz/model/binarypackagename.py |
1638 | @@ -7,10 +7,6 @@ __all__ = [ |
1639 | ] |
1640 | |
1641 | import six |
1642 | -from sqlobject import ( |
1643 | - SQLObjectNotFound, |
1644 | - StringCol, |
1645 | - ) |
1646 | from storm.expr import Join |
1647 | from storm.store import EmptyResultSet |
1648 | from zope.interface import implementer |
1649 | @@ -18,6 +14,10 @@ from zope.interface import implementer |
1650 | from lp.app.errors import NotFoundError |
1651 | from lp.services.database.interfaces import IStore |
1652 | from lp.services.database.sqlbase import SQLBase |
1653 | +from lp.services.database.sqlobject import ( |
1654 | + SQLObjectNotFound, |
1655 | + StringCol, |
1656 | + ) |
1657 | from lp.soyuz.interfaces.binarypackagename import ( |
1658 | IBinaryPackageName, |
1659 | IBinaryPackageNameSet, |
1660 | diff --git a/lib/lp/soyuz/model/binarypackagerelease.py b/lib/lp/soyuz/model/binarypackagerelease.py |
1661 | index 34551ce..0ba1681 100644 |
1662 | --- a/lib/lp/soyuz/model/binarypackagerelease.py |
1663 | +++ b/lib/lp/soyuz/model/binarypackagerelease.py |
1664 | @@ -9,12 +9,6 @@ __all__ = [ |
1665 | from operator import attrgetter |
1666 | |
1667 | import simplejson |
1668 | -from sqlobject import ( |
1669 | - BoolCol, |
1670 | - ForeignKey, |
1671 | - IntCol, |
1672 | - StringCol, |
1673 | - ) |
1674 | from storm.locals import ( |
1675 | Date, |
1676 | Int, |
1677 | @@ -29,6 +23,12 @@ from lp.services.database.constants import UTC_NOW |
1678 | from lp.services.database.datetimecol import UtcDateTimeCol |
1679 | from lp.services.database.enumcol import EnumCol |
1680 | from lp.services.database.sqlbase import SQLBase |
1681 | +from lp.services.database.sqlobject import ( |
1682 | + BoolCol, |
1683 | + ForeignKey, |
1684 | + IntCol, |
1685 | + StringCol, |
1686 | + ) |
1687 | from lp.services.propertycache import ( |
1688 | cachedproperty, |
1689 | get_property_cache, |
1690 | diff --git a/lib/lp/soyuz/model/component.py b/lib/lp/soyuz/model/component.py |
1691 | index b835e1b..b747ca3 100644 |
1692 | --- a/lib/lp/soyuz/model/component.py |
1693 | +++ b/lib/lp/soyuz/model/component.py |
1694 | @@ -7,14 +7,14 @@ __all__ = [ |
1695 | 'ComponentSet' |
1696 | ] |
1697 | |
1698 | -from sqlobject import ( |
1699 | - ForeignKey, |
1700 | - StringCol, |
1701 | - ) |
1702 | from zope.interface import implementer |
1703 | |
1704 | from lp.app.errors import NotFoundError |
1705 | from lp.services.database.sqlbase import SQLBase |
1706 | +from lp.services.database.sqlobject import ( |
1707 | + ForeignKey, |
1708 | + StringCol, |
1709 | + ) |
1710 | from lp.soyuz.interfaces.component import ( |
1711 | IComponent, |
1712 | IComponentSelection, |
1713 | diff --git a/lib/lp/soyuz/model/distributionsourcepackagecache.py b/lib/lp/soyuz/model/distributionsourcepackagecache.py |
1714 | index 1fd5775..0d1fdcc 100644 |
1715 | --- a/lib/lp/soyuz/model/distributionsourcepackagecache.py |
1716 | +++ b/lib/lp/soyuz/model/distributionsourcepackagecache.py |
1717 | @@ -9,10 +9,6 @@ from operator import ( |
1718 | itemgetter, |
1719 | ) |
1720 | |
1721 | -from sqlobject import ( |
1722 | - ForeignKey, |
1723 | - StringCol, |
1724 | - ) |
1725 | from zope.interface import implementer |
1726 | |
1727 | from lp.code.model.seriessourcepackagebranch import SeriesSourcePackageBranch |
1728 | @@ -22,6 +18,10 @@ from lp.services.database import bulk |
1729 | from lp.services.database.decoratedresultset import DecoratedResultSet |
1730 | from lp.services.database.interfaces import IStore |
1731 | from lp.services.database.sqlbase import SQLBase |
1732 | +from lp.services.database.sqlobject import ( |
1733 | + ForeignKey, |
1734 | + StringCol, |
1735 | + ) |
1736 | from lp.soyuz.interfaces.distributionsourcepackagecache import ( |
1737 | IDistributionSourcePackageCache, |
1738 | ) |
1739 | diff --git a/lib/lp/soyuz/model/distroarchseries.py b/lib/lp/soyuz/model/distroarchseries.py |
1740 | index cb01aed..e8eef7a 100644 |
1741 | --- a/lib/lp/soyuz/model/distroarchseries.py |
1742 | +++ b/lib/lp/soyuz/model/distroarchseries.py |
1743 | @@ -9,14 +9,6 @@ __all__ = [ |
1744 | import hashlib |
1745 | from io import BytesIO |
1746 | |
1747 | -from sqlobject import ( |
1748 | - BoolCol, |
1749 | - ForeignKey, |
1750 | - IntCol, |
1751 | - SQLObjectNotFound, |
1752 | - SQLRelatedJoin, |
1753 | - StringCol, |
1754 | - ) |
1755 | from storm.locals import ( |
1756 | Int, |
1757 | Join, |
1758 | @@ -36,6 +28,14 @@ from lp.services.database.decoratedresultset import DecoratedResultSet |
1759 | from lp.services.database.enumcol import EnumCol |
1760 | from lp.services.database.interfaces import IStore |
1761 | from lp.services.database.sqlbase import SQLBase |
1762 | +from lp.services.database.sqlobject import ( |
1763 | + BoolCol, |
1764 | + ForeignKey, |
1765 | + IntCol, |
1766 | + SQLObjectNotFound, |
1767 | + SQLRelatedJoin, |
1768 | + StringCol, |
1769 | + ) |
1770 | from lp.services.database.stormexpr import ( |
1771 | fti_search, |
1772 | rank_by_fti, |
1773 | diff --git a/lib/lp/soyuz/model/distroseriespackagecache.py b/lib/lp/soyuz/model/distroseriespackagecache.py |
1774 | index 337e7cd..6ea1989 100644 |
1775 | --- a/lib/lp/soyuz/model/distroseriespackagecache.py |
1776 | +++ b/lib/lp/soyuz/model/distroseriespackagecache.py |
1777 | @@ -8,10 +8,6 @@ __all__ = [ |
1778 | from collections import defaultdict |
1779 | from operator import attrgetter |
1780 | |
1781 | -from sqlobject import ( |
1782 | - ForeignKey, |
1783 | - StringCol, |
1784 | - ) |
1785 | from storm.expr import ( |
1786 | Desc, |
1787 | Max, |
1788 | @@ -22,6 +18,10 @@ from zope.interface import implementer |
1789 | from lp.services.database import bulk |
1790 | from lp.services.database.interfaces import IStore |
1791 | from lp.services.database.sqlbase import SQLBase |
1792 | +from lp.services.database.sqlobject import ( |
1793 | + ForeignKey, |
1794 | + StringCol, |
1795 | + ) |
1796 | from lp.soyuz.interfaces.distroseriespackagecache import ( |
1797 | IDistroSeriesPackageCache, |
1798 | ) |
1799 | diff --git a/lib/lp/soyuz/model/files.py b/lib/lp/soyuz/model/files.py |
1800 | index 256b21f..c14b7cc 100644 |
1801 | --- a/lib/lp/soyuz/model/files.py |
1802 | +++ b/lib/lp/soyuz/model/files.py |
1803 | @@ -7,12 +7,12 @@ __all__ = [ |
1804 | 'SourcePackageReleaseFile', |
1805 | ] |
1806 | |
1807 | -from sqlobject import ForeignKey |
1808 | from zope.interface import implementer |
1809 | |
1810 | from lp.registry.interfaces.sourcepackage import SourcePackageFileType |
1811 | from lp.services.database.enumcol import EnumCol |
1812 | from lp.services.database.sqlbase import SQLBase |
1813 | +from lp.services.database.sqlobject import ForeignKey |
1814 | from lp.soyuz.enums import BinaryPackageFileType |
1815 | from lp.soyuz.interfaces.files import ( |
1816 | IBinaryPackageFile, |
1817 | diff --git a/lib/lp/soyuz/model/packagediff.py b/lib/lp/soyuz/model/packagediff.py |
1818 | index ecfeccd..5b16c29 100644 |
1819 | --- a/lib/lp/soyuz/model/packagediff.py |
1820 | +++ b/lib/lp/soyuz/model/packagediff.py |
1821 | @@ -16,7 +16,6 @@ import subprocess |
1822 | import tempfile |
1823 | |
1824 | import six |
1825 | -from sqlobject import ForeignKey |
1826 | from storm.expr import Desc |
1827 | from storm.store import EmptyResultSet |
1828 | from zope.component import getUtility |
1829 | @@ -33,6 +32,7 @@ from lp.services.database.sqlbase import ( |
1830 | SQLBase, |
1831 | sqlvalues, |
1832 | ) |
1833 | +from lp.services.database.sqlobject import ForeignKey |
1834 | from lp.services.librarian.interfaces import ILibraryFileAliasSet |
1835 | from lp.services.librarian.model import ( |
1836 | LibraryFileAlias, |
1837 | diff --git a/lib/lp/soyuz/model/publishing.py b/lib/lp/soyuz/model/publishing.py |
1838 | index f7c1fb1..ff4d2bb 100644 |
1839 | --- a/lib/lp/soyuz/model/publishing.py |
1840 | +++ b/lib/lp/soyuz/model/publishing.py |
1841 | @@ -21,11 +21,6 @@ import sys |
1842 | |
1843 | import pytz |
1844 | import six |
1845 | -from sqlobject import ( |
1846 | - ForeignKey, |
1847 | - IntCol, |
1848 | - StringCol, |
1849 | - ) |
1850 | from storm.expr import ( |
1851 | And, |
1852 | Cast, |
1853 | @@ -61,6 +56,11 @@ from lp.services.database.interfaces import ( |
1854 | IStore, |
1855 | ) |
1856 | from lp.services.database.sqlbase import SQLBase |
1857 | +from lp.services.database.sqlobject import ( |
1858 | + ForeignKey, |
1859 | + IntCol, |
1860 | + StringCol, |
1861 | + ) |
1862 | from lp.services.database.stormexpr import IsDistinctFrom |
1863 | from lp.services.librarian.browser import ProxiedLibraryFileAlias |
1864 | from lp.services.librarian.model import ( |
1865 | diff --git a/lib/lp/soyuz/model/queue.py b/lib/lp/soyuz/model/queue.py |
1866 | index 29b5a2d..42d7c3f 100644 |
1867 | --- a/lib/lp/soyuz/model/queue.py |
1868 | +++ b/lib/lp/soyuz/model/queue.py |
1869 | @@ -17,12 +17,6 @@ from operator import attrgetter |
1870 | |
1871 | import pytz |
1872 | import six |
1873 | -from sqlobject import ( |
1874 | - ForeignKey, |
1875 | - SQLMultipleJoin, |
1876 | - SQLObjectNotFound, |
1877 | - StringCol, |
1878 | - ) |
1879 | from storm.expr import Cast |
1880 | from storm.locals import ( |
1881 | And, |
1882 | @@ -70,6 +64,12 @@ from lp.services.database.sqlbase import ( |
1883 | SQLBase, |
1884 | sqlvalues, |
1885 | ) |
1886 | +from lp.services.database.sqlobject import ( |
1887 | + ForeignKey, |
1888 | + SQLMultipleJoin, |
1889 | + SQLObjectNotFound, |
1890 | + StringCol, |
1891 | + ) |
1892 | from lp.services.database.stormbase import StormBase |
1893 | from lp.services.database.stormexpr import ( |
1894 | Array, |
1895 | diff --git a/lib/lp/soyuz/model/section.py b/lib/lp/soyuz/model/section.py |
1896 | index 7d0005b..13f9334 100644 |
1897 | --- a/lib/lp/soyuz/model/section.py |
1898 | +++ b/lib/lp/soyuz/model/section.py |
1899 | @@ -7,14 +7,14 @@ __all__ = [ |
1900 | 'SectionSet' |
1901 | ] |
1902 | |
1903 | -from sqlobject import ( |
1904 | - ForeignKey, |
1905 | - StringCol, |
1906 | - ) |
1907 | from zope.interface import implementer |
1908 | |
1909 | from lp.app.errors import NotFoundError |
1910 | from lp.services.database.sqlbase import SQLBase |
1911 | +from lp.services.database.sqlobject import ( |
1912 | + ForeignKey, |
1913 | + StringCol, |
1914 | + ) |
1915 | from lp.soyuz.interfaces.section import ( |
1916 | ISection, |
1917 | ISectionSelection, |
1918 | diff --git a/lib/lp/soyuz/model/sourcepackagerelease.py b/lib/lp/soyuz/model/sourcepackagerelease.py |
1919 | index f8d06fe..2615be9 100644 |
1920 | --- a/lib/lp/soyuz/model/sourcepackagerelease.py |
1921 | +++ b/lib/lp/soyuz/model/sourcepackagerelease.py |
1922 | @@ -20,11 +20,6 @@ from debian.changelog import ( |
1923 | ) |
1924 | import pytz |
1925 | import six |
1926 | -from sqlobject import ( |
1927 | - ForeignKey, |
1928 | - SQLMultipleJoin, |
1929 | - StringCol, |
1930 | - ) |
1931 | from storm.expr import Join |
1932 | from storm.locals import ( |
1933 | Desc, |
1934 | @@ -53,6 +48,11 @@ from lp.services.database.sqlbase import ( |
1935 | SQLBase, |
1936 | sqlvalues, |
1937 | ) |
1938 | +from lp.services.database.sqlobject import ( |
1939 | + ForeignKey, |
1940 | + SQLMultipleJoin, |
1941 | + StringCol, |
1942 | + ) |
1943 | from lp.services.librarian.model import ( |
1944 | LibraryFileAlias, |
1945 | LibraryFileContent, |
1946 | diff --git a/lib/lp/soyuz/scripts/gina/handlers.py b/lib/lp/soyuz/scripts/gina/handlers.py |
1947 | index 2af6e5d..e4b8eb6 100644 |
1948 | --- a/lib/lp/soyuz/scripts/gina/handlers.py |
1949 | +++ b/lib/lp/soyuz/scripts/gina/handlers.py |
1950 | @@ -23,7 +23,6 @@ import os |
1951 | import re |
1952 | |
1953 | import six |
1954 | -from sqlobject import SQLObjectNotFound |
1955 | from storm.exceptions import NotOneError |
1956 | from storm.expr import ( |
1957 | Cast, |
1958 | @@ -47,6 +46,7 @@ from lp.registry.model.sourcepackagename import SourcePackageName |
1959 | from lp.services.database.constants import UTC_NOW |
1960 | from lp.services.database.interfaces import IStore |
1961 | from lp.services.database.sqlbase import quote |
1962 | +from lp.services.database.sqlobject import SQLObjectNotFound |
1963 | from lp.services.librarian.interfaces import ILibraryFileAliasSet |
1964 | from lp.services.scripts import log |
1965 | from lp.soyuz.enums import ( |
1966 | diff --git a/lib/lp/translations/model/pofile.py b/lib/lp/translations/model/pofile.py |
1967 | index b977bda..afdb444 100644 |
1968 | --- a/lib/lp/translations/model/pofile.py |
1969 | +++ b/lib/lp/translations/model/pofile.py |
1970 | @@ -15,12 +15,6 @@ import datetime |
1971 | |
1972 | import pytz |
1973 | import six |
1974 | -from sqlobject import ( |
1975 | - BoolCol, |
1976 | - ForeignKey, |
1977 | - IntCol, |
1978 | - StringCol, |
1979 | - ) |
1980 | from storm.expr import ( |
1981 | And, |
1982 | Cast, |
1983 | @@ -62,6 +56,12 @@ from lp.services.database.sqlbase import ( |
1984 | quote, |
1985 | SQLBase, |
1986 | ) |
1987 | +from lp.services.database.sqlobject import ( |
1988 | + BoolCol, |
1989 | + ForeignKey, |
1990 | + IntCol, |
1991 | + StringCol, |
1992 | + ) |
1993 | from lp.services.mail.helpers import get_email_template |
1994 | from lp.services.propertycache import cachedproperty |
1995 | from lp.services.webapp.publisher import canonical_url |
1996 | diff --git a/lib/lp/translations/model/pofiletranslator.py b/lib/lp/translations/model/pofiletranslator.py |
1997 | index 83f500a..2ded0d1 100644 |
1998 | --- a/lib/lp/translations/model/pofiletranslator.py |
1999 | +++ b/lib/lp/translations/model/pofiletranslator.py |
2000 | @@ -8,7 +8,6 @@ __all__ = [ |
2001 | |
2002 | from operator import itemgetter |
2003 | |
2004 | -from sqlobject import ForeignKey |
2005 | from storm.expr import ( |
2006 | And, |
2007 | Join, |
2008 | @@ -26,6 +25,7 @@ from lp.services.database.datetimecol import UtcDateTimeCol |
2009 | from lp.services.database.decoratedresultset import DecoratedResultSet |
2010 | from lp.services.database.interfaces import IStore |
2011 | from lp.services.database.sqlbase import SQLBase |
2012 | +from lp.services.database.sqlobject import ForeignKey |
2013 | from lp.translations.interfaces.pofiletranslator import ( |
2014 | IPOFileTranslator, |
2015 | IPOFileTranslatorSet, |
2016 | diff --git a/lib/lp/translations/model/potemplate.py b/lib/lp/translations/model/potemplate.py |
2017 | index 5d0d9ec..45f6a99 100644 |
2018 | --- a/lib/lp/translations/model/potemplate.py |
2019 | +++ b/lib/lp/translations/model/potemplate.py |
2020 | @@ -19,13 +19,6 @@ import os |
2021 | |
2022 | from psycopg2.extensions import TransactionRollbackError |
2023 | import six |
2024 | -from sqlobject import ( |
2025 | - BoolCol, |
2026 | - ForeignKey, |
2027 | - IntCol, |
2028 | - SQLMultipleJoin, |
2029 | - StringCol, |
2030 | - ) |
2031 | from storm.expr import ( |
2032 | And, |
2033 | Desc, |
2034 | @@ -63,6 +56,13 @@ from lp.services.database.sqlbase import ( |
2035 | flush_database_updates, |
2036 | SQLBase, |
2037 | ) |
2038 | +from lp.services.database.sqlobject import ( |
2039 | + BoolCol, |
2040 | + ForeignKey, |
2041 | + IntCol, |
2042 | + SQLMultipleJoin, |
2043 | + StringCol, |
2044 | + ) |
2045 | from lp.services.helpers import shortlist |
2046 | from lp.services.mail.helpers import get_email_template |
2047 | from lp.services.propertycache import cachedproperty |
2048 | diff --git a/lib/lp/translations/model/potmsgset.py b/lib/lp/translations/model/potmsgset.py |
2049 | index ad48fa2..c52e074 100644 |
2050 | --- a/lib/lp/translations/model/potmsgset.py |
2051 | +++ b/lib/lp/translations/model/potmsgset.py |
2052 | @@ -14,7 +14,6 @@ import logging |
2053 | import re |
2054 | |
2055 | import six |
2056 | -from sqlobject import StringCol |
2057 | from storm.expr import ( |
2058 | And, |
2059 | Coalesce, |
2060 | @@ -49,6 +48,7 @@ from lp.services.database.sqlbase import ( |
2061 | SQLBase, |
2062 | sqlvalues, |
2063 | ) |
2064 | +from lp.services.database.sqlobject import StringCol |
2065 | from lp.services.database.stormexpr import ( |
2066 | IsTrue, |
2067 | NullsFirst, |
2068 | diff --git a/lib/lp/translations/model/translationgroup.py b/lib/lp/translations/model/translationgroup.py |
2069 | index c138acc..a3e0f48 100644 |
2070 | --- a/lib/lp/translations/model/translationgroup.py |
2071 | +++ b/lib/lp/translations/model/translationgroup.py |
2072 | @@ -8,13 +8,6 @@ __all__ = [ |
2073 | |
2074 | import operator |
2075 | |
2076 | -from sqlobject import ( |
2077 | - ForeignKey, |
2078 | - SQLMultipleJoin, |
2079 | - SQLObjectNotFound, |
2080 | - SQLRelatedJoin, |
2081 | - StringCol, |
2082 | - ) |
2083 | from storm.expr import ( |
2084 | Desc, |
2085 | Join, |
2086 | @@ -36,6 +29,13 @@ from lp.services.database.interfaces import ( |
2087 | IStore, |
2088 | ) |
2089 | from lp.services.database.sqlbase import SQLBase |
2090 | +from lp.services.database.sqlobject import ( |
2091 | + ForeignKey, |
2092 | + SQLMultipleJoin, |
2093 | + SQLObjectNotFound, |
2094 | + SQLRelatedJoin, |
2095 | + StringCol, |
2096 | + ) |
2097 | from lp.services.librarian.model import ( |
2098 | LibraryFileAlias, |
2099 | LibraryFileContent, |
2100 | diff --git a/lib/lp/translations/model/translationmessage.py b/lib/lp/translations/model/translationmessage.py |
2101 | index 42c1987..564cfa8 100644 |
2102 | --- a/lib/lp/translations/model/translationmessage.py |
2103 | +++ b/lib/lp/translations/model/translationmessage.py |
2104 | @@ -12,12 +12,6 @@ __all__ = [ |
2105 | from datetime import datetime |
2106 | |
2107 | import pytz |
2108 | -from sqlobject import ( |
2109 | - BoolCol, |
2110 | - ForeignKey, |
2111 | - SQLObjectNotFound, |
2112 | - StringCol, |
2113 | - ) |
2114 | from storm.expr import And |
2115 | from storm.locals import ( |
2116 | Int, |
2117 | @@ -49,6 +43,12 @@ from lp.services.database.sqlbase import ( |
2118 | SQLBase, |
2119 | sqlvalues, |
2120 | ) |
2121 | +from lp.services.database.sqlobject import ( |
2122 | + BoolCol, |
2123 | + ForeignKey, |
2124 | + SQLObjectNotFound, |
2125 | + StringCol, |
2126 | + ) |
2127 | from lp.services.propertycache import ( |
2128 | cachedproperty, |
2129 | get_property_cache, |
2130 | diff --git a/lib/lp/translations/model/translationrelicensingagreement.py b/lib/lp/translations/model/translationrelicensingagreement.py |
2131 | index ca3d9ae..79263ef 100644 |
2132 | --- a/lib/lp/translations/model/translationrelicensingagreement.py |
2133 | +++ b/lib/lp/translations/model/translationrelicensingagreement.py |
2134 | @@ -5,16 +5,16 @@ __all__ = [ |
2135 | 'TranslationRelicensingAgreement', |
2136 | ] |
2137 | |
2138 | -from sqlobject import ( |
2139 | - BoolCol, |
2140 | - ForeignKey, |
2141 | - ) |
2142 | from zope.interface import implementer |
2143 | |
2144 | from lp.registry.interfaces.person import validate_public_person |
2145 | from lp.services.database.constants import UTC_NOW |
2146 | from lp.services.database.datetimecol import UtcDateTimeCol |
2147 | from lp.services.database.sqlbase import SQLBase |
2148 | +from lp.services.database.sqlobject import ( |
2149 | + BoolCol, |
2150 | + ForeignKey, |
2151 | + ) |
2152 | from lp.translations.interfaces.translationrelicensingagreement import ( |
2153 | ITranslationRelicensingAgreement, |
2154 | ) |
2155 | diff --git a/lib/lp/translations/model/translationtemplateitem.py b/lib/lp/translations/model/translationtemplateitem.py |
2156 | index e563d06..1de5219 100644 |
2157 | --- a/lib/lp/translations/model/translationtemplateitem.py |
2158 | +++ b/lib/lp/translations/model/translationtemplateitem.py |
2159 | @@ -5,13 +5,13 @@ __all__ = [ |
2160 | 'TranslationTemplateItem', |
2161 | ] |
2162 | |
2163 | -from sqlobject import ( |
2164 | - ForeignKey, |
2165 | - IntCol, |
2166 | - ) |
2167 | from zope.interface import implementer |
2168 | |
2169 | from lp.services.database.sqlbase import SQLBase |
2170 | +from lp.services.database.sqlobject import ( |
2171 | + ForeignKey, |
2172 | + IntCol, |
2173 | + ) |
2174 | from lp.translations.interfaces.translationtemplateitem import ( |
2175 | ITranslationTemplateItem, |
2176 | ) |
2177 | diff --git a/lib/lp/translations/model/translator.py b/lib/lp/translations/model/translator.py |
2178 | index 93e0804..c27821e 100644 |
2179 | --- a/lib/lp/translations/model/translator.py |
2180 | +++ b/lib/lp/translations/model/translator.py |
2181 | @@ -3,10 +3,6 @@ |
2182 | |
2183 | __all__ = ['Translator', 'TranslatorSet'] |
2184 | |
2185 | -from sqlobject import ( |
2186 | - ForeignKey, |
2187 | - StringCol, |
2188 | - ) |
2189 | from storm.expr import Join |
2190 | from storm.store import Store |
2191 | from zope.interface import implementer |
2192 | @@ -16,6 +12,10 @@ from lp.registry.model.teammembership import TeamParticipation |
2193 | from lp.services.database.constants import DEFAULT |
2194 | from lp.services.database.datetimecol import UtcDateTimeCol |
2195 | from lp.services.database.sqlbase import SQLBase |
2196 | +from lp.services.database.sqlobject import ( |
2197 | + ForeignKey, |
2198 | + StringCol, |
2199 | + ) |
2200 | from lp.translations.interfaces.translator import ( |
2201 | ITranslator, |
2202 | ITranslatorSet, |
2203 | diff --git a/lib/lp/translations/scripts/fix_plural_forms.py b/lib/lp/translations/scripts/fix_plural_forms.py |
2204 | index cc6dfed..85cadd1 100644 |
2205 | --- a/lib/lp/translations/scripts/fix_plural_forms.py |
2206 | +++ b/lib/lp/translations/scripts/fix_plural_forms.py |
2207 | @@ -7,10 +7,9 @@ __all__ = [ |
2208 | 'fix_plurals_in_all_pofiles', |
2209 | ] |
2210 | |
2211 | -from sqlobject import SQLObjectNotFound |
2212 | - |
2213 | from lp.services.database.interfaces import IStore |
2214 | from lp.services.database.sqlbase import cursor |
2215 | +from lp.services.database.sqlobject import SQLObjectNotFound |
2216 | from lp.translations.interfaces.translations import TranslationConstants |
2217 | from lp.translations.model.pofile import POFile |
2218 | from lp.translations.model.potmsgset import POTMsgSet |
2219 | diff --git a/lib/lp/translations/vocabularies.py b/lib/lp/translations/vocabularies.py |
2220 | index fe52925..b3b5617 100644 |
2221 | --- a/lib/lp/translations/vocabularies.py |
2222 | +++ b/lib/lp/translations/vocabularies.py |
2223 | @@ -13,7 +13,6 @@ __all__ = [ |
2224 | 'TranslationTemplateVocabulary', |
2225 | ] |
2226 | |
2227 | -from sqlobject import AND |
2228 | from storm.locals import ( |
2229 | Desc, |
2230 | Not, |
2231 | @@ -22,6 +21,7 @@ from storm.locals import ( |
2232 | from zope.schema.vocabulary import SimpleTerm |
2233 | |
2234 | from lp.registry.interfaces.distroseries import IDistroSeries |
2235 | +from lp.services.database.sqlobject import AND |
2236 | from lp.services.webapp.vocabulary import ( |
2237 | NamedSQLObjectVocabulary, |
2238 | SQLObjectVocabularyBase, |
Looks fine, but I think it would make more sense as `lp.services. database. sqlobject` rather than `lp.services. sqlobject` . Would you consider moving it one level deeper?