aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/mixin.py
Commit message (Collapse)AuthorAgeFilesLines
* do not show error message when it's not a exceptionBoris Bobrov2016-02-231-1/+1
| | | | | | | | Gah, the previous patch was not enough! We cannot use text, we can only use exception with a special attribute. Lets return safe None for now an resolve this properly later, when we're not in the freeze.
* Catch import error when text is used as a reason instead of pathBoris Bobrov2016-02-231-1/+11
| | | | | | | | fail_error was used in import, but due to some changes text could appear there and it caused an error. There is little sense now to remove these text messages because they are probably in databases already, so just ignore import errors.
* Display type icon in thumbnailsBoris Bobrov2016-02-051-4/+13
|
* Comment changes for federationJessica Tallon2015-10-201-3/+66
| | | | | | | | | | | | | | 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-22/+38
| | | | | | | | 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.
* Collection changes and migration for federationJessica Tallon2015-10-071-8/+8
| | | | | | | - 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-3/+3
| | | | | | | | | | | | | | | | | | 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-6/+5
| | | | | | 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-0/+19
| | | | | | 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).
* Fix some problems with activity mixins and migrationsJessica Tallon2015-05-261-5/+4
|
* Change 'federation' name to 'api' which is more suitableJessica Tallon2015-02-151-2/+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 #1054 - Add missing attributes to Activity.serializeJessica Tallon2014-12-081-0/+5
|
* 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!
* Fix #1025 - Make API IDs IRIsJessica Tallon2014-11-211-1/+7
|
* Fix #1023 - Make timestamps in API timezone awareJessica Tallon2014-11-191-2/+5
|
* Fix problem where duplicate slug would cause an update exceptionJessica Tallon2014-10-221-15/+18
|
* Add __repr__ to Activity and Generator classJessica Tallon2014-10-071-1/+1
|
* Fix all the unit tests and clean up codeJessica Tallon2014-10-061-9/+9
|
* Fix migrations and refactor object_typeJessica Tallon2014-09-021-1/+14
| | | | | | | - 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-1/+108
| | | | | | | | | | - 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 __unicode__ representation to Notification and MediaCommentMixinTryggvi Bjorgvinsson2014-07-251-1/+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.
* Fix by thallian: use correct datetime.strptimeChristopher Allan Webber2014-07-241-1/+1
| | | | datetime.dateime already imported, so....
* Add image URL's (thumb & full)Jessica Tallon2014-07-221-0/+11
|
* Use unicode for logging commentsTryggvi Bjorgvinsson2014-07-181-1/+1
| | | | | | | | | | | | | The comment problems detailed in issue 791 are related to logging of comments creation. The log tries to format unicode comments into an ascii string (that is the unicode comment content). This also creates problems with mark seen functionality since that also logs the comments which breaks and you end up with a lot of international comments in your message queue. This commit makes both log messages unicode as well as the representation of the comment.
* Issue #686: Create User.url_for_self() method.Berker Peksag2014-04-101-0/+6
| | | | | *Note from cwebber on merge of this branch:* Thanks also to Sturm who provided an early version of this patch.
* Merge branch 'ticket-679' into OPW-Moderation-Updatetilly-Q2013-07-291-8/+16
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: mediagoblin/auth/tools.py mediagoblin/auth/views.py mediagoblin/db/migration_tools.py mediagoblin/db/migrations.py mediagoblin/db/models.py mediagoblin/decorators.py mediagoblin/user_pages/views.py
| * Switching the hook 'get_media_manager' to a more "directed" tuple-hookChristopher Allan Webber2013-07-121-1/+1
| | | | | | | | | | | | | | | | By switching this to a tuple that includes the media type in the key itself, this requires iteration and execution of functions that "check" that they are the right type. This commit sponsored by Greg Grossmeier. Thanks buddy! :)
| * Fix the last bit preventing all the unit tests from passing in media ↵Christopher Allan Webber2013-07-121-1/+2
| | | | | | | | | | | | | | types->plugins The last commit was also small, so Jeff Moe gets... two! Two sponsored commits! Ah ah ah. </count_voice>
| * fixed some typos and enabled media_type plugins in testsRodney Ewing2013-07-021-1/+2
| |
| * modified gmg to use plugin media_types and converted image media_type to new ↵Rodney Ewing2013-07-021-9/+6
| | | | | | | | plugin style
| * New notificationsJoar Wandborg2013-06-091-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added request.notifications - Email configuration fixes - Set config_spec default SMTP port to `0` and switch to SSL/non-SSL default if `port == 0` - Added email_smtp_use_ssl configuration setting - Added migrations for notification tables - Added __repr__ to MediaComment(Mixin) - Added MediaComment.get_entry => MediaEntry - Added CommentSubscription, CommentNotification, Notification, ProcessingNotification tables - Added notifications.task to celery init - Fixed a bug in the video transcoder where pygst would hijack the --help argument. - Added notifications - views - silence - subscribe - routes - utility methods - celery task - Added half-hearted .active comment CSS style - Added quick JS to show header_dropdown - Added fragment template to show notifications in header_dropdown - Added fragment template to show subscribe/unsubscribe buttons on media/comment pages - Updated celery setup tests with notifications.task - Tried to fix test_misc tests that I broke - Added notification tests - Added and extended tests.tools fixtures - Integrated new notifications into media_home, media_post_comment views - Bumped SQLAlchemy dependency to >= 0.8.0 since we need polymorphic for the notifications to work
* | This update I mostly did work on the templates for the admin pages. I did a co-tilly-Q2013-07-081-1/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -uple other small changes. I changed the information around the media processi- ng panel to be more specific, since it was written when it was the only admin page. Git didn't catch this, but I renamed the templates, so mediagoblin/templ- ates/admin/user.html now referrs to the page which shows the details of a spec- ific user. The list view pages are now named ELEMENT_panel.html(ie. user_panel) I also added a column reported_user_id to the ReportBase table, and had to add to Report filing to make sure that column gets created. Also I moved the report media button (on a media page) to the sidebar, though it still needs some form- atting --\ mediagoblin/static/images/icon_clipboard.png --| Added this image for use in template mediagoblin/admin/report.html. --| Distributed by the GNOME project http://www.gnome.org --| Under a GNU LGPL v.3 or Creative Commons BY-SA 3.0 license. --| I'm still trying to figure out the appropriate way to attribute this in | the code --\ mediagoblin/templates/mediagoblin/admin/media_panel.html --| This template is actually the template formerly know as media.html. I | renamed it for clarity --\ mediagoblin/templates/mediagoblin/admin/report_panel.html --| This template is actually the template formerly know as report.html. I | renamed it for clarity --\ mediagoblin/templates/mediagoblin/admin/user_panel.html --| This template is actually the template formerly know as user.html. I renam- | -ed it for clarity --\ mediagoblin/templates/mediagoblin/utils/report.html --| This template is included in the media_home page. It is the report media | button. I figured I'd write it like this in case it got more complicated. --\ mediagoblin/admin/routing.py --| I changed the routing path /a/panel to /a/media for specificity --\ mediagoblin/admin/views.py --| I renamed admin_processing_panel to admin_media_processing_panel --| I wrote a new view function admin_reports_detail --| I wrote a new view function admin_users_detail --\ mediagoblin/db/migrations.py --| I added in the column reported_user_id to the ReportBase_v0 class --\ mediagoblin/db/models.py --| I added in the column reported_user_id to the ReportBase class --\ mediagoblin/static/css/base.css --| I added in css classes to display a report. Right now, they are just echo- | -ing the ways comments are displayed, but with the link in another color --\ mediagoblin/templates/mediagoblin/admin/report.html --| Created this new template (although git doesn't realize it) to show the de- | -tails of a specific report, indicated in the URL --\ mediagoblin/templates/mediagoblin/admin/user.html --| Created this new template (although git doesn't realize it) to show the de- | -tails of a specific user, indicated in the URL --\ mediagoblin/templates/mediagoblin/base.html --| Redirected the link from /a/panel to /a/media --\ mediagoblin/templates/mediagoblin/user_pages/media.html --| Moved the media report button to the sidebar --\ mediagoblin/user_pages/lib.py --| Changed the creation of reports, so that they also assign a column for rep- | -orted_user_id.
* created a check_login_simple functionRodney Ewing2013-05-281-8/+0
| | | | | | cherry-picked from rodney757, fixed few conflicts due to out of order cherry-picking. Thanks to rodney757 for making my idea even better.
* Cleaned up EXIF viewJoar Wandborg2013-05-231-9/+23
| | | | | | The last update made the assumption that EXIF metadata is in some way consistent between camera models, images, manufacturers. This update takes into account that nothing is certain whenever EXIF is involved.
* Only calculate aperture if fnumber is providedJoar Wandborg2013-05-201-7/+6
|
* Take into account incomplete EXIF dataJoar Wandborg2013-05-201-9/+18
|
* Modifies EXIF section with Camera Info, display toggle and template stylingGabriel Saldana2013-05-201-0/+27
|
* Changes to display all EXIF informationGabriel Saldana2013-05-201-5/+3
|
* MediaManager: Use .foo instead of ['foo'].Elrond2013-04-171-1/+1
| | | | To make .media_fetch_order work, create a property.
* First step towards a MediaManager class: Compat one.Elrond2013-04-171-1/+1
| | | | | | To get us moving towards a MediaManager class, the first idea is to create a class that wraps our current dict based manager and makes all users happy.
* Better docs for GenerateSlugMixin.Elrond2013-04-061-1/+9
|
* Use GenerateSlugMixin for collections.Elrond2013-04-061-12/+3
| | | | | Use the new way of generating slugs also for collections. Also drop the dummy_db arg to check_collection_slug_used.
* Refactor generate_slug into a mixin.Elrond2013-04-061-9/+13
| | | | | Refactor the new generate_slug into a mixin to allow it to be used for collections also.
* A bit of pep8: Remove useless whitespace.Elrond2013-03-301-5/+5
|
* self.media_data->self.media_manager in the docstring. Thanks for catching, ↵Christopher Allan Webber2013-03-031-1/+1
| | | | | | Elrond. This commit sponsored by Sebastian Hugentobler. Thank you!
* No reason really to pass in fetch_order anyway...Christopher Allan Webber2013-03-031-7/+5
| | | | | | | I think this is legacy code from get_display_media being a utility, or something. Removed! (Thanks for pointing this out, Elrond!) This commit sponsored by Tristan Chambers. Thank you!
* Huge amount of work to (mostly) allow .ogg (and maybe other) formats to skip ↵Christopher Allan Webber2013-03-021-9/+15
| | | | | | | | | | | | | | | | | | | transcode - Update get_display_media in several ways: - now uses the media type's own declaration of the order of things - returns both the media_size and the media_path, as per the docstring - implicitly uses self.media_files as opposed to forcing you to pass it in - update videos to use get_display_media - update images to declare media_fetch_order in the media manager (videos also) - update stl to use media.media_files['original'] instead of weird use of get_display_media - update sidebar to only conditionally show webm_640 TODO still: identify video type information *during* processing, show that in the <video><source /></video> element. This commit sponsored by Nathan Yergler. Thanks, nyergler!
* Media URLs with ids in them are now like /u/cwebber/m/id:4112/ rather than ↵Christopher Allan Webber2013-02-261-2/+4
| | | | | | | | /u/cwebber/m/4112/ This avoids some potential name collision issues. This commit sponsored by Asokan Pichai. Thank you!