aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Comment changes for federationJessica Tallon2015-10-201-1/+28
| | | | | | | | | | | | | | This adds a new Comment link table that is used to link between some object and then the comment object, which can be more or less any object in Mediagoblin. The MediaComment has been renamed to TextComment as that more aptly describes what it is. There is migrations for these changes. There is also the conslidation of the Report tables into a single Report table, the same with the Notification objects. This is because both of them split out MediaEntry and Comment versions into their own polymorphic versions from a base, this is no longer a meaningful distinction as comments can be anything.
* Add Graveyard modelJessica Tallon2015-10-071-43/+44
| | | | | | | | | | This adds the Graveyard model which is used when a model is deleted, it stores the important "shell" information on the model so it can hard-delete the real object. It also remaps the GenericModelReference references to the new Graveyard model. This also moves the soft deletion setting from __model_args__ to "deletion_mode" on the model.
* Add the __model_args__ deletion codeJessica Tallon2015-10-071-1/+53
| | | | | | | | This adds the "deleted" fields to the models as well as a new __model_args__ section whcih supports the option for changing the deletion type. Deletion is now handled by choosing a deletion method based on the __model_args__["deletion"] setting, for example if it's soft deletion it will call Model.soft_delete()
* Attach the MediaGoblinApp to the engine, and provide a way for models to accessChristopher Allan Webber2014-12-031-0/+4
| | | | | | | 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!
* Move the scoped_session, sessionmaker importsChristopher Allan Webber2014-12-031-1/+1
|
* An environment variable to transition towards removing global variablesChristopher Allan Webber2014-12-031-5/+9
|
* Give our sqlalchemy objects access to their own sessionChristopher Allan Webber2014-12-031-0/+6
|
* Fix #984 - Improvements to Activity and ActivityIntermediatorJessica Tallon2014-10-211-2/+5
| | | | | | - Add unit tests to cover get and set methods on Activity - Rewrite the set to remove set and use Session.flush instead - Use sqlalchemy's validator instead of .save hack
* Patch by Strum. Ticket #451 - Convert all mongokit style .find, .find_one, ↵Rodney Ewing2013-07-111-12/+0
| | | | .one calls over to SQLAlchemy queries
* Remove custom GMQuery classSebastian Spaeth2013-01-071-14/+1
| | | | | | | | | We provided a custom GMQuery class that offered a .sort() method for compatibility with the Mongo syntax. Now that we have settled for sqlalchemy which uses the order_by() method, we can safely remove this custom class and move a little closer to "pure" and native sqlalchemy usage. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Mv db.sql.base to db.baseSebastian Spaeth2013-01-071-0/+91
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.