aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/open.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove remaining imports/calls to six not automatically removed by pyupgrade.Ben Sturmfels2021-03-051-1/+0
|
* Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code.Ben Sturmfels2021-03-051-4/+4
|
* There's absolutely no reason for a Session().commit object mirrored onto ↵Christopher Allan Webber2014-12-031-4/+0
| | | | | | Session() :) Thanks for catching, Elrond :)
* Attach the MediaGoblinApp to the engine, and provide a way for models to accessChristopher Allan Webber2014-12-031-1/+6
| | | | | | | This allows SQLAlchemy models to gain access to app-level configuration without the need for global variables. This commit sponsored by Peter Hogg. Thank you, Peter!
* Adding query property to DatabaseMaster for forward compatibilityChristopher Allan Webber2014-12-031-0/+4
|
* Attach the base models to sessions and the DatabaseMaster for backwards ↵Christopher Allan Webber2014-12-031-2/+14
| | | | | | compatibility Really we should stop relying on that though.
* Some docstringsChristopher Allan Webber2014-12-031-0/+13
|
* Return DatabaseManager or DatabaseMaster depending on DISABLE_GLOBALSChristopher Allan Webber2014-12-031-2/+6
| | | | They're both similar! One sets up sessions, one grabs sessions from a global object.
* Oops, got the boolean backwards :PChristopher Allan Webber2014-12-031-1/+1
|
* Adding DatabaseManager as an alternative to DatabaseMasterChristopher Allan Webber2014-12-031-25/+77
| | | | | This is another step to get to a no-globals configuration. I'm not sure if this code works yet or not... :)
* Cleanup mediagoblin._compat and fix translation tests.Berker Peksag2014-07-281-2/+3
|
* Continue to port GMG codebase.Berker Peksag2014-05-081-1/+2
|
* modified gmg to use plugin media_types and converted image media_type to new ↵Rodney Ewing2013-07-021-4/+0
| | | | plugin style
* Switch "sqlite_refcheck" keyword arg to "migrations" which Elrond thinks is ↵Christopher Allan Webber2013-04-261-3/+15
| | | | | | cleaner Also, if migrations is true, *explicitly* say that foreign key checking is off
* Don't turn on sqlite refcheck stuff during migrationsChristopher Allan Webber2013-04-261-2/+2
|
* Enable foreign key checking on sqlite.Elrond2013-01-181-1/+12
| | | | | | sqlite normally does not check foreign key referential integrity. But it can do so. So let's use it. Better safe than sorry.
* Mv db.sql.base to db.baseSebastian Spaeth2013-01-071-1/+1
| | | | | | | | This concludes the db.sql.* -> db.* move. Our db abstraction layer is sqlalchemy, so there is no need to a separate db.sql.* hierarchy. All tests have been run for each of the commit series to make sure everything works at every step.
* Move db.sql.models* to db.models*Sebastian Spaeth2013-01-071-1/+1
|
* Move db.sql.open to db.openSebastian Spaeth2012-12-251-3/+62
| | | | | | Now that mongo has been ripped out and sqlalchemy is already providing the database abstraction, there is no need to hide everything in the sql module. Transition db.sql.open to db.open and adapt all direct importers.
* RIP out mongoSebastian Spaeth2012-12-251-11/+1
| | | | | | | | | Since sqlalchemy is providing our database abstraction and we have moved away from Mongo as the underlying database, it is now time to simplify things and rip out mongo. This provides the bulk of the changes, and can stand on its own. There are some followup tasks that can be done, such as removing now unneeded abstraction layers, e.g. db.sql.fake.py
* Create load_models().Elrond2012-03-201-2/+4
| | | | | | | | | | | | So all models are ready when connecting to the db and so our "db" object has all models listed on it, create a function to load all models from the media_types, etc. Call it in setup_database() Problem: This gives celery warnings, because celery is imported before being setup properly. No idea how to fix this now. So media-type loading is excluded from load_models for now.
* It's 2012 all up in hereChristopher Allan Webber2012-02-021-1/+1
|
* Add develover sql switchElrond2012-01-281-2/+11
| | | | | | | | | | | | | | | | | If you want to play with the current state of sql, you need a switch to turn it on. So here is the super secret developer switch. So you want to know where it is? Here it is: Create a file mediagoblin/db/sql_switch.py and put one line in it: "use_sql = True" (or False to disable again). Right, that's it. If you want to delete it, remember to delete the *.pyc too. Be careful not to "git add" it by accident!
* Factor out check_db_migrations_currentElrond2012-01-011-1/+2
| | | | | | | | | | When initializing the database connection the current mongo based setup checked for new migrations and warned about them. This was mongo specific so factor'd it out into a more generic check_db_migrations_current function in the mongo backend. Also created a dummy one in the sql backend.
* Move db/open.py to db/mongo/open.pyElrond2011-12-201-39/+1
| | | | | | | | | | | | Starting to move the mongo specific stuff into db/mongo. And create thin "from db.mongo.Y import z" wrappers in db/Y.py. Why? 1) Will make it lots easier to switch to sql for testing/developing. 2) The mongo stuff needs to stay around after moving to sql, because the converter needs it.
* Whitespace and formatting cleanup.Nathan Yergler2011-10-011-1/+1
| | | | | | | * Removed trailing whitespace * Line length < 80 where possible * Honor conventions on number of blank lines * Honor conventions about spaces around :, =
* 508. Updates copyright/license informationWill Kahn-Greene2011-09-011-1/+1
|
* Merge branch 'master' into f411_new_migrationsChristopher Allan Webber2011-07-131-1/+2
|\ | | | | | | | | Conflicts: mediagoblin/db/open.py
| * Move db_name default into config_spec.iniElrond2011-07-111-1/+1
| | | | | | | | | | | | | | The default name of the database ("mediagoblin") was coded in db/open.py and init/celery/__init__.py. Instead use the new config system to have this as the default for the "db_name" config option.
* | give option in connect_database_from_config to connect to a pymongo.ConnectionChristopher Allan Webber2011-07-101-8/+25
|/
* Factor out most of the database connection into db/open.pyElrond2011-05-191-0/+37
I needed to split the db connection/opening into open.py, due to an import loop: - util.py needs db/util.py:ObjectId - db/util.py would need db/models.py - db/models.py needs util.py:slugify