600 Commits

Author SHA1 Message Date
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
c785f3a090 Fix problem where duplicate slug would cause an update exception 2014-10-22 18:59:04 +01: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
Berker Peksag
cca5d508ad Add initial migration guide.
This can be moved to docs/source/devel/migrations.rst.
2014-10-02 20:18:29 +03:00
Berker Peksag
2ace351bed Do not call AlembicMigrationManager.init_tables() for now.
sqlalchemy-migrate will do this for us.
2014-10-02 20:18:29 +03:00
Jessica Tallon
7e15632b5a Fix #549 - Deauthorize OAuth applications 2014-10-01 19:45:53 +01:00
Christopher Allan Webber
36e27c4b76 Fix migrations on Python 2.
This commit sponsored by Loïc Grobol.  Thank you!
2014-09-30 16:34:15 -05: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
a7800e6da8 Fix a python2.6 compatibility issue. Removing a dict comprehension.
This commit sponsored by Christopher Beppler.  Thanks!
2014-08-18 10:40:08 -05:00
Christopher Allan Webber
cbc5f9500c Always remove the session when running check_db_up_to_date()
This commit sponsored by Francois Marier.  Thank you!
2014-08-15 16:30:59 -05:00
Berker Peksag
de51eca53f Provide a better manager API for Alembic. 2014-08-15 15:39:45 +03:00
Berker Peksag
65f20ca435 Add initial Alembic migrations. 2014-08-13 19:30:23 +03:00
Christopher Allan Webber
3b104bbcef Elrond keeps pointing out places I should "is not None" at :) 2014-08-08 13:24:59 -05:00
Christopher Allan Webber
113d1a280e Okay, we don't know that indexes are falsey, so let's make it clearer. Yeek! 2014-08-08 13:18:57 -05:00
Christopher Allan Webber
72f42a408d this negation needs parens. 2014-08-08 13:12:33 -05:00
Christopher Allan Webber
f2a6db9088 Pull the indexes out of the dictionary directly
Instead of checking for their keys and pulling them out later, that is.
2014-08-08 11:39:44 -05:00
Christopher Allan Webber
ed0b981edc If the constraint already exists, roll back to a sane state. 2014-08-08 09:50:16 -05:00
Christopher Allan Webber
1de794c6f0 Explaining why we're committing mid-migration 2014-08-08 09:47:33 -05:00
Christopher Allan Webber
e6288a68e1 Only add the constraint if we need to. Catch an exception if we don't.
Also, updating the comment about sqlite being crazy :)
2014-08-07 16:29:45 -05:00
Christopher Allan Webber
3a8d0e145e Document both migrations, comment out old migration 2014-08-07 15:01:09 -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
Berker Peksag
cf3b5926f4 Cleanup mediagoblin._compat and fix translation tests. 2014-07-28 13:27:19 +03:00
Berker Peksag
98d8b365af func_name removed in Python 3. 2014-07-28 10:35:14 +03: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
Christopher Allan Webber
196cef381d Fix by thallian: use correct datetime.strptime
datetime.dateime already imported, so....
2014-07-24 12:09:17 -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
Jessica Tallon
d70b7a5167 Fix issue where create_uuid doesn't exist nor used 2014-07-22 23:13:15 +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