aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/models.py
Commit message (Collapse)AuthorAgeFilesLines
* Collection changes and migration for federationJessica Tallon2015-10-071-39/+81
| | | | | | | - 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-241-21/+22
| | | | | | | | | | | | | | | | | | 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 serialization after model changesJessica Tallon2015-08-201-4/+6
| | | | | | 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-191-10/+9
| | | | | | 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-311-7/+7
| | | | | | | | 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.
* Add polymorphic properties to UserJessica Tallon2015-07-311-0/+16
| | | | | | | | | | 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-311-58/+97
|
* Fix some problems with activity mixins and migrationsJessica Tallon2015-05-261-13/+14
|
* Add a more verbose GenericForeignKey implementationJessica Tallon2015-05-261-65/+36
|
* 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-261-56/+0
| | | | | 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-261-46/+26
|
* Add GenericForeignKey field and reference helper modelJessica Tallon2015-05-261-2/+78
|
* Fix #1065 - Migrate from native datetimes to UTCJessica Tallon2015-02-151-20/+20
|
* Change 'federation' name to 'api' which is more suitableJessica Tallon2015-02-151-7/+7
|
* Fix #1052 - Make activity cascade delete work when deleting a userJessica Tallon2015-01-271-1/+2
|
* 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 #1049 - name renamed to displayName for LocationJessica Tallon2014-12-051-3/+3
|
* 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-211-11/+28
|
* 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-191-4/+11
|
* Fix User and MediaEntry serialize and add serialize to models which need itJessica Tallon2014-11-041-2/+17
|
* Fix #984 - Improvements to Activity and ActivityIntermediatorJessica Tallon2014-10-211-8/+9
| | | | | | - 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
* Merge branch 'location'Jessica Tallon2014-10-091-4/+112
|\ | | | | | | | | | | | | | | | | | | | | | | Add Location model which holds textual, geolocation coordiantes or postal addresses. This migrates data off Image model metadata onto the general Location model. It also adds the ability for location to be set on MediaEntry, User, MediaComment and Collection models. The geolocation plugin has been updated so that the location can be displayed in more general places rather than explicitely on the MediaEntry view. If GPS coordiantes are set for the User the profile page will also have the OSM provided by the geolocation plugin.
| * Add location model and migrationsJessica Tallon2014-10-091-5/+114
| |
* | Merge branch '905-activities'Jessica Tallon2014-10-071-13/+189
|\ \ | | | | | | | | | | | | | | | Add Activity and Generator models which allow for activities to be created. This now works with the feed API.
| * | Add __repr__ to Activity and Generator classJessica Tallon2014-10-071-0/+18
| | |
| * | Fix bug where activity.content was not populatedJessica Tallon2014-10-061-2/+6
| | |
| * | Fix all the unit tests and clean up codeJessica Tallon2014-10-061-2/+2
| | |
| * | Only have Model.activity for activity compatable objects/targetsJessica Tallon2014-09-031-62/+34
| | |
| * | Fix migrations and refactor object_typeJessica Tallon2014-09-021-45/+36
| | | | | | | | | | | | | | | | | | | | | - Make changes to objectType to be more pythonic "object_type" - Move object_type to mixins rather than be on the models - Convert migrations to sqlalchemy core rather than ORM (fix) - Change TYPES to use descriptive strings rather than numbers
| * | Add ActivityIntermediator table and refactor some of Activity modelJessica Tallon2014-08-271-182/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - This has introduced a intermediatory table between object/target and the activity. This allows for multiple activities to be associated with one object/target. - This moves some of the methods off Activity model into a mixin which didn't need to interact with database things. - This also cleaned up the migrations as well as adding retroactive creation of activities for collection creation.
| * | Add better support for targets on ActivitiesJessica Tallon2014-08-261-43/+80
| | | | | | | | | | | | | | | | | | This adds betters upport for targets in the content generation and on the model itself. Adding getters for properties which would otherwise require looking up e.g. get_author.
| * | Create activity model and add activity creationJessica Tallon2014-08-221-3/+191
| |/ | | | | | | | | | | | | | | This creates the Activity and Genrator models from the Activity Streams spec and. I then created a migration which retro-actively create activities for media uploaded and comments created. Through out the code I've added so automatically activties are created when a user peforms an action (uploading media, commenting, etc.).
* | Fix #549 - Deauthorize OAuth applicationsJessica Tallon2014-10-011-0/+4
| |
* | Merge branch 'master' into merge-python3-portChristopher Allan Webber2014-09-161-19/+201
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Has some issues, will iteratively fix! Conflicts: mediagoblin/gmg_commands/__init__.py mediagoblin/gmg_commands/deletemedia.py mediagoblin/gmg_commands/users.py mediagoblin/oauth/views.py mediagoblin/plugins/api/views.py mediagoblin/tests/test_api.py mediagoblin/tests/test_edit.py mediagoblin/tests/test_oauth1.py mediagoblin/tests/test_util.py mediagoblin/tools/mail.py mediagoblin/webfinger/views.py setup.py
| * | Add __repr__ for Collection and CollectionItemOdin Hørthe Omdal2014-09-071-1/+15
| |/
| * Tidy up federation code and add tests to cover more of the APIsJessica Tallon2014-08-181-10/+3
| |
| * Add a new migration which removes/fixes the old migrationChristopher Allan Webber2014-08-071-1/+1
| | | | | | | | | | | | | | The previous migration, as it turns out, was not needed, and there were many inconsistencies put in place by adding it. See issue #920. This commit sponsored by Gergő Tisza. Thank you!
| * Fix #927 - Clean up federation code after Elrond's reviewJessica Tallon2014-07-301-1/+11
| | | | | | | | | | | | | | | | - Add json_error and use inplace of json_response where appropriate. - Add garbage_collection to config spec file. - Fix bugs in both garbage collection task and test - Handle /api/whoami when no user logged in and a test for such a case. - Validate ID is correct and user has comment privilege to comment.
| * Fix #923 - add allow_admin to user_has_privilege decoratorJessica Tallon2014-07-291-14/+15
| |
| * Add __unicode__ representation to Notification and MediaCommentMixinTryggvi Bjorgvinsson2014-07-251-0/+8
| | | | | | | | | | | | Instead of having __repr__ return a unicode object which it should not do, we use the __unicode__ method to allow use of Notification and MediaCommentMixin objects in unicode strings.
| * Switch from slug to ID and clean up style to conform to PEP-8Jessica Tallon2014-07-221-2/+2
| |
| * Add unseralize for API objectsJessica Tallon2014-07-221-0/+31
| |