aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/models.py
Commit message (Collapse)AuthorAgeFilesLines
* fixed bug #728Boris Bobrov2016-07-251-3/+3
|
* Fix #5376 - Ensure links have correct IDJessica Tallon2016-03-011-13/+2
| | | | | | | 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 #5431 - Typo in modelsAndrew Browning2016-03-011-1/+1
| | | | Fix a typo in models.py.
* Fix #5415 - Deleted comments get removed properly when tombstonesJessica Tallon2016-02-291-0/+11
| | | | | | The original wrapper existed and should be been removed, this fix now ensures the TextComment removes the Comment wrapper to prevent the deleted (comments which are tombstones) existing.
* Fix #5369 - Broken activities cause issues in migrationsJessica Tallon2016-01-061-1/+1
| | | | | | | | | | | This fixes a few bugs in previous migrations and then also introduces a new migration for those who had run the previous migrations without encountering the bugs to ensure that the database is in the same state as those who ran it after the bug fixes introduced in this commit. The commit also ensures that all activities are valid, they should be but they might not be so checks, from now on we should be able to assume that all activities will always be valid.
* Fix #5363 - Collections don't serialize correctlyJessica Tallon2015-11-251-1/+1
|
* Fix #5354 & #5355 - Fix Graveyard.serializeJessica Tallon2015-11-231-7/+14
| | | | | | | | | Graveyard.serialize raised an exception as the deleted datetime objects where not being converted to strings for json encoding. It also didn't deal with the case when there was an actor, it now calls the actor's serialize method as it should. Thanks to Alyeph who provided the patches for both of these.
* Use urljoin to create proper feed media URLsayleph2015-11-191-2/+3
|
* Comment changes for federationJessica Tallon2015-10-201-149/+138
| | | | | | | | | | | | | | 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 public_id fixes throughout the codeJessica Tallon2015-10-071-1/+3
| | | | | | | | This adds several things, mainly code which checks for the public id and if it doesn't exist generating it where it can. This is to because we need to keep the public_id to be able to effectively soft delete models. This also adds a public_id field to the Activity along with a migration.
* Add Graveyard modelJessica Tallon2015-10-071-24/+66
| | | | | | | | | | 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/+28
| | | | | | | | 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()
* 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.