aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db
Commit message (Collapse)AuthorAgeFilesLines
* Collection changes and migration for federationJessica Tallon2015-10-075-50/+235
| | | | | | | - Adds a "type" column to the Collection object and allows the CollectionItem model to contain any object. - Changes "items" to "num_items" as per TODO - Renames "uploader", "creator" and "user" to a common "actor" in most places
* Fix some unit tests and bugsJessica Tallon2015-08-243-25/+27
| | | | | | | | | | | | | | | | | | This fixes a lot of the issues with the LocalUser changes that were merged recently. There was a problem where the attributes of LocalUser were not being eagerly loaded and because the Session was detached an exception was being raised when they were accessed. This also fixes some typo's which were introduced. Finally this adds a temporary fix for a potential SQLAlchemy bug, this is a bug where doing: User.query.filter(LocalUser.username == "some_username").first() does NOT yeild a user with the username "some_username" but all users on the site. The temp fix is to just query the LocalUser, this should be resolved when bug is confirmed and fixed upstream.
* Fix #5344 - OAuth NotImplemented exceptionJessica Tallon2015-08-211-0/+59
| | | | | | | | | | | | This introduces a migration which adds a dummy Client, RequestToken and AccessToken. These are used when an invalid request comes in, instead of bailing early, it needs dummy data to prevent timing attacks. This then implements the methods which get the IDs of the dummy objects. If these are changed in the future a migration which checks for the previous dummy object should be created and updates them to reflect the new IDs/tokens.
* Fix serialization after model changesJessica Tallon2015-08-202-10/+11
| | | | | | After the recent model changes there were some bugs which were introduced into the serialization methods of the models. This commit fixes those issues.
* Change structure of MediaEntry and add migrationJessica Tallon2015-08-193-13/+70
| | | | | | This makes the changes needed for federating MediaEntry objects as well as adding the migration and necessary methods to get the public_id just in time (JIT).
* Add the user models to the MODELS listJessica Tallon2015-07-312-16/+37
| | | | | | | | This adds the two new user models (LocalUser and RemoteUser) to the MODELS list that is in models.py. This stops the strange bug that occurs if you migrate a fresh database, the two models don't exist however migrating an existing database would create them as the migrations exist.
* Change codebase to query or create correct User modelJessica Tallon2015-07-311-0/+1
| | | | | | | The code base had many references to User.username and other specific to LocalUser attributes as that was the way it use to exist. This updates those to query on the generic User model but filtering by attributes on the LocalUser.
* Add polymorphic properties to UserJessica Tallon2015-07-312-3/+25
| | | | | | | | | | This adds the ability to search for any user based on the generic User case and be given back the specific LocalUser or RemoteUser. This will require any code using the model to look which attributes they are searching on and specify the specific User model they are on if they're not on the generic User model. This will also require new users to be created with LocalUser.
* Add LocalUser and RemoteUser and migrationJessica Tallon2015-07-312-58/+217
|
* Fix removal of ActivityIntermediatory migrationJessica Tallon2015-06-241-2/+19
| | | | | | | | | | The migration had a problem where other tables still referenced the migration as well as a typo in an earlier migration. They have both been fixed and tested on PostgreSQL and SQLite3. This also fixes a bug where sometimes when creating an activity it'd raise an Exception as the object hadn't got an ID. This has been fixed globally with a fix to the create_activity federation tool.
* Fix some problems with activity mixins and migrationsJessica Tallon2015-05-263-21/+21
|
* Add a more verbose GenericForeignKey implementationJessica Tallon2015-05-262-67/+38
|
* Remove deprecated fields and fix activity creation in toolsJessica Tallon2015-05-261-9/+0
|
* More fixed recommended by ElrondJessica Tallon2015-05-261-11/+8
| | | | | | | This fixes the problem where GenericForeignKey could only be used with models that are in the core of Mediagoblin, it now can be used with any model that SQLAlchemy knows about, including plugins. This also fixes some small bugs caused by incorrect ordering of params into a function.
* Add some fixes Elrond suggested and doc stringsJessica Tallon2015-05-261-14/+41
|
* Add migration to remove ActivityIntermediatorJessica Tallon2015-05-262-59/+12
| | | | | Migration to drop the table and removal of it from the model as it has now been superseeded by the GenericForeignKey field.
* Fix the GenericForeignKey implementationJessica Tallon2015-05-261-22/+36
|
* Migrate Activity to using the new GenericForeignKeyJessica Tallon2015-05-262-47/+166
|
* Add GenericForeignKey field and reference helper modelJessica Tallon2015-05-262-2/+93
|
* Fix the token issues in the migrationChristopher Allan Webber2015-02-171-3/+3
| | | | | | There's no .id on access/request token tables, so fixed to use the .token field. Also switched a reference of client_table -> rt_table
* acess_token->access_tokenChristopher Allan Webber2015-02-171-1/+1
|
* Fixing typo: notifiction->notificationChristopher Allan Webber2015-02-171-1/+1
|
* This one should be dt_to_utc, not db_to_utc, I believeChristopher Allan Webber2015-02-171-1/+1
|
* Fix #1065 - Migrate from native datetimes to UTCJessica Tallon2015-02-152-20/+146
|
* Change 'federation' name to 'api' which is more suitableJessica Tallon2015-02-152-9/+9
|
* Fix #1052 - Make activity cascade delete work when deleting a userJessica Tallon2015-01-271-1/+2
|
* Fix 1e0c938 by allowing target to be translatable in Activity.contentJessica Tallon2014-12-221-9/+17
|
* Allow Activity.content to be fully translatableJessica Tallon2014-12-221-2/+19
|
* Fix #1077 - Fix updating comment via API and add testJessica Tallon2014-12-161-22/+16
|
* Fix #1053 - Add height and width attributes and MetadataProcess taskJessica Tallon2014-12-111-0/+16
| | | | | | | | Added "height" and "width" attributes to "image" and "fullImage" in the API where possible. The height and width of images wasn't being stored anywhere so I've created a task to add or update the metadata on images and also started adding those to new images when they're submitted in the InitialProcessor.
* Fix #1054 - Add missing attributes to Activity.serializeJessica Tallon2014-12-081-0/+5
|
* Fix #1049 - name renamed to displayName for LocationJessica Tallon2014-12-051-3/+3
|
* There's absolutely no reason for a Session().commit object mirrored onto ↵Christopher Allan Webber2014-12-031-4/+0
| | | | | | Session() :) Thanks for catching, Elrond :)
* Make all mixin methods ignore mg_globals and use self._app insteadChristopher Allan Webber2014-12-031-4/+3
| | | | This commit sponsored by Daniel Lang. Thank you!
* Attach the MediaGoblinApp to the engine, and provide a way for models to accessChristopher Allan Webber2014-12-032-1/+10
| | | | | | | 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.
* Only conditionally import Session in db/util.pyChristopher Allan Webber2014-12-031-1/+5
|
* Move the scoped_session, sessionmaker importsChristopher Allan Webber2014-12-031-1/+1
|
* 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... :)
* 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 #1040 - Comments should have published attributeJessica Tallon2014-11-271-1/+4
|
* Fix unicode handling in "gmg addmedia".Berker Peksag2014-11-221-1/+5
|
* Fix #1025 - Make API IDs IRIsJessica Tallon2014-11-212-12/+35
|
* Fix #1039 - Fix typo in user model 'oublished' to 'published'Jessica Tallon2014-11-201-1/+1
|
* Fix #1023 - Make timestamps in API timezone awareJessica Tallon2014-11-192-6/+16
|