208 Commits

Author SHA1 Message Date
Jessica Tallon
c1d27aa019 Add a more verbose GenericForeignKey implementation 2015-05-26 16:48:59 +02:00
Jessica Tallon
d2256d0b3b Remove deprecated fields and fix activity creation in tools 2015-05-26 16:48:59 +02:00
Jessica Tallon
2e4782ef6d More fixed recommended by Elrond
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.
2015-05-26 16:48:59 +02:00
Jessica Tallon
0b405a3ee2 Add some fixes Elrond suggested and doc strings 2015-05-26 16:48:59 +02:00
Jessica Tallon
e8b44d7c09 Add migration to remove ActivityIntermediator
Migration to drop the table and removal of it from the model as it has
now been superseeded by the GenericForeignKey field.
2015-05-26 16:48:59 +02:00
Jessica Tallon
6185a4b9e6 Fix the GenericForeignKey implementation 2015-05-26 16:48:58 +02:00
Jessica Tallon
bfe1e8ce88 Migrate Activity to using the new GenericForeignKey 2015-05-26 16:48:58 +02:00
Jessica Tallon
641ae2f1e1 Add GenericForeignKey field and reference helper model 2015-05-26 16:48:58 +02:00
Jessica Tallon
d705f3b760 Fix #1065 - Migrate from native datetimes to UTC 2015-02-15 17:17:01 +01:00
Jessica Tallon
4fd520364f Change 'federation' name to 'api' which is more suitable 2015-02-15 17:17:01 +01:00
Jessica Tallon
63d6953774 Fix #1052 - Make activity cascade delete work when deleting a user 2015-01-27 13:31:29 +00:00
Jessica Tallon
9e715bb07f Fix #1077 - Fix updating comment via API and add test 2014-12-16 12:05:18 +00:00
Jessica Tallon
4a09d5956a Fix #1053 - Add height and width attributes and MetadataProcess task
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.
2014-12-11 11:52:34 +00:00
Jessica Tallon
5b7e6bb8c2 Fix #1049 - name renamed to displayName for Location 2014-12-05 14:04:18 +00:00
Jessica Tallon
1c8f52daee Fix #1040 - Comments should have published attribute 2014-11-27 10:13:21 +00:00
Berker Peksag
9d85dcdf11 Fix unicode handling in "gmg addmedia". 2014-11-22 18:12:19 +00:00
Jessica Tallon
9c602458d8 Fix #1025 - Make API IDs IRIs 2014-11-21 13:30:31 +00:00
Jessica Tallon
34b755f43d Fix #1039 - Fix typo in user model 'oublished' to 'published' 2014-11-20 10:14:43 +00:00
Jessica Tallon
45e687fcf8 Fix #1023 - Make timestamps in API timezone aware 2014-11-19 10:49:53 +00:00
Jessica Tallon
c511fc5e5e Fix User and MediaEntry serialize and add serialize to models which need it 2014-11-04 10:42:31 +00:00
Jessica Tallon
5ddc85e071 Fix #984 - Improvements to Activity and ActivityIntermediator
- 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
2014-10-21 11:44:11 +01:00
Jessica Tallon
ed48454558 Merge branch 'location'
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.
2014-10-09 19:20:13 +01:00
Jessica Tallon
c0434db469 Add location model and migrations 2014-10-09 19:16:54 +01:00
Jessica Tallon
9a1fc423ac Merge branch '905-activities'
Add Activity and Generator models which allow for
    activities to be created. This now works with the
    feed API.
2014-10-07 10:01:38 +01:00
Jessica Tallon
2b1916182d Add __repr__ to Activity and Generator class 2014-10-07 10:00:37 +01:00
Jessica Tallon
240e987016 Fix bug where activity.content was not populated 2014-10-06 11:48:08 +01:00
Jessica Tallon
6d36f75f84 Fix all the unit tests and clean up code 2014-10-06 11:48:03 +01:00
Jessica Tallon
7e15632b5a Fix #549 - Deauthorize OAuth applications 2014-10-01 19:45:53 +01:00
Christopher Allan Webber
f6bad0eb26 Merge branch 'master' into merge-python3-port
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
2014-09-16 14:01:43 -05:00
Odin Hørthe Omdal
4f1a5148cb Add __repr__ for Collection and CollectionItem 2014-09-07 09:42:07 -05:00
Jessica Tallon
b61519ce53 Only have Model.activity for activity compatable objects/targets 2014-09-03 15:58:40 +01:00
Jessica Tallon
0421fc5ee8 Fix migrations and refactor object_type
- 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
2014-09-02 16:38:52 +01:00
Jessica Tallon
ce46470c02 Add ActivityIntermediator table and refactor some of Activity model
- 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.
2014-08-27 15:20:27 +01:00
Jessica Tallon
1c15126819 Add better support for targets on Activities
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.
2014-08-26 10:19:39 +01:00
Jessica Tallon
b949201152 Create activity model and add activity creation
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.).
2014-08-22 23:18:01 +01:00
Jessica Tallon
9246a6ba89 Tidy up federation code and add tests to cover more of the APIs 2014-08-18 10:51:32 -05:00
Christopher Allan Webber
bb12fb807e Add a new migration which removes/fixes the old migration
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!
2014-08-07 14:57:46 -05:00
Jessica Tallon
5e5d445890 Fix #927 - Clean up federation code after Elrond's review
- 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.
2014-07-30 21:53:52 +01:00
Jessica Tallon
7bfc81b21a Fix #923 - add allow_admin to user_has_privilege decorator 2014-07-29 20:29:02 +01:00
Tryggvi Bjorgvinsson
dc19e98d98 Add __unicode__ representation to Notification and MediaCommentMixin
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.
2014-07-25 14:37:57 -05:00
Jessica Tallon
a14d90c2db Switch from slug to ID and clean up style to conform to PEP-8 2014-07-22 23:13:17 +01:00
Jessica Tallon
d8f55f2b41 Add unseralize for API objects 2014-07-22 23:13:16 +01:00
Jessica Tallon
3c8bd177b2 Add test for API object endpoint 2014-07-22 23:13:16 +01:00
Jessica Tallon
51ab51921e Add more tests for federation APIs 2014-07-22 23:13:16 +01:00
xray7224
7810817caf Refactors api uploading to media managers 2014-07-22 23:13:15 +01:00
Jessica Tallon
c894b4246a Add basic comment support and flesh out some other endpoints 2014-07-22 23:13:15 +01:00
Jessica Tallon
c434fc31c9 Add static pump_io to API and fix problem where null appeared in profile 2014-07-22 23:13:14 +01:00
xray7224
a5682e8960 Support some webfinger API's and real profile and /api/user/<user>/ 2014-07-22 23:13:14 +01:00
xray7224
98596dd072 Support for the comments endpoint 2014-07-22 23:13:14 +01:00
xray7224
37f070b067 Fixes problem where full URL was being used inplace of host 2014-07-22 23:13:14 +01:00