aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove remaining imports/calls to six not automatically removed by pyupgrade.Ben Sturmfels2021-03-051-3/+2
|
* Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code.Ben Sturmfels2021-03-051-3/+3
|
* Fix #5376 - Ensure links have correct IDJessica Tallon2016-03-011-1/+7
| | | | | | | This ensures that links to comments have the correct ID (the ID of the Comment object) as well as fixing deletion on reports and fixing a few other little things. I hope this fixes the #5376 issue, though cannot reproduce so unable to confirm.
* Fix #5390 - Create migration to delete Notifications and fix ReportJessica Tallon2016-01-201-3/+18
| | | | | | | When a user deleted media or other objects any notificationn objects or reports would cause errors as the object doesn't exist anymore. This now removes them or sets them to None as expected by the code. This also adds some code to the base deletion code to make sure this happens when an object is deleted.
* Fix #5382 - Add migration and fix so tombstones are removed from collectionsJessica Tallon2016-01-151-0/+26
| | | | | | | | | | | | When an item is deleted it should be removed from all collections, this commit makes that happen. It's got two changes: 1. Adds the code so when an object is soft deleted, it's automatically removed from all collection items 2. Add a migration to fix this issue for those who have tombstones (Graveyard objects) in their collections because of this bug. This commit requires you to run a migration
* 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.