Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1051)

Issue 7226049: Get rid of the global DB object

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by abel.deuring
Modified:
11 years, 3 months ago
Reviewers:
rharding, hazmat, mp+145206
Visibility:
Public.

Description

Get rid of the global DB object This is very simple fix; the solution as described in http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/database/mongodb.html turns out to be a bit more complicated: Creating the DB object in a NewRequest event does not work for unit tests derived from ViewTestBase because charmworld.main() is not called for these tests. https://code.launchpad.net/~adeuring/charmworld/no-global-db-obj-2/+merge/145206 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -4 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M charmworld/models.py View 2 chunks +4 lines, -4 lines 1 comment Download

Messages

Total messages: 3
abel.deuring
Please take a look.
11 years, 3 months ago (2013-01-28 16:36:28 UTC) #1
rharding
lgtm to me, I think this addresses the desire to not have a global db ...
11 years, 3 months ago (2013-01-28 16:41:48 UTC) #2
hazmat
11 years, 3 months ago (2013-01-28 16:57:05 UTC) #3
the tests should separately setup the db connection and subscriber ala

http://pylons.readthedocs.org/projects/pyramid/en/latest/api/config.html#pyra...


as is the branch doesn't really get rid of the global, just substitutes a global
ref for an attribute access on another global ref.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b