aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/mixin.py
Commit message (Collapse)AuthorAgeFilesLines
* Simplify/Robustify the thumbnail URL usage in templatesSebastian Spaeth2012-11-151-0/+19
| | | | | | | | | | | | | | | | | | | | | | So far templates required a very complex blurb to simply insert a thumbnail URL, exposing much of the internal logic to the template designer. In addition, we would fail with an error if for some reason the media_files['thumb'] entry was never populated. This adds the MediaEntry.thumb_url property that template designers can simply use. It will do the right thing, either fetching the proper thumbnail or hand back a generic icon specified in a media's MEDIA_MANAGER as "default_thumb". Add an image default fallback icon (stolen from Tangos, which are Public Domain since version 0.8.90 as I understand) since the one we referred to was not existing. Perhaps, a "broken image" icon would be better, but I'll leave that to our capable designers. All templates have been modified to make use of the new thumb_url function. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* Style fixesJoar Wandborg2012-09-181-0/+1
|
* Fixed collection sidebar for media_home to user collection.url_for_self ↵Aaron Williamson2012-09-181-1/+1
| | | | instead of incorrectly getting the session user
* Added basic collection functionalityAaron Williamson2012-09-181-0/+53
|
* Minor improvements to the processing panelJoar Wandborg2012-07-101-2/+2
| | | | | | - It is now possible to actually see what's processing, due to a bug fix where __getitem__ was called on the db model. - Removed DEPRECATED message from the docstring, it wasn't true.
* Prevent non-Unicode SQLAlchemy warnings in most submission tests.Brett Smith2012-07-081-1/+1
| | | | This commit makes test_submission mostly warning-clean.
* Fix cyclic import issue.Elrond2012-03-231-1/+2
| | | | | | | | Oh well: tools.exif -> processing -> db.util -> db.models -> db.mixin -> tools.exif So import tools.exif locally in exif_display_iter()
* Create MediaEntry.exif_display_iter()Elrond2012-03-231-0/+10
| | | | | | | | MediaEntry.media_data.exif_all will contain all the "clean" EXIF data. MediaEntry.exif_display_iter() is an iterator that fetches the most interesting entries for display from that data.
* Generic generate_slug for mongo and sql.Elrond2012-03-071-0/+18
| | | | | | | | | | Using the new check_media_slug_used it is possible to have one generic generate_slug in the mixin class instead of in each db class. In the sql variant self.id is not always set: If the slug alone would create a dupe the current code decides for "no slug at all".
* Drop pre-rendered html: MediaComment.content_htmlElrond2012-02-181-0/+10
| | | | | | | | | | | After a bit of discussion, we decided to drop the pre-rendered html from the database and render it on the fly. In another step, we will use some proper caching method to cache this stuff. This commit affects the MediaComment.content_html part.
* Drop pre-rendered html: MediaEntry.description_htmlElrond2012-02-181-0/+8
| | | | | | | | | | | After a bit of discussion, we decided to drop the pre-rendered html from the database and render it on the fly. In another step, we will use some proper caching method to cache this stuff. This commit affects the MediaEntry.description_html part.
* Drop pre-rendered html: User.bio_htmlElrond2012-02-181-0/+5
| | | | | | | | | | | After a bit of discussion, we decided to drop the pre-rendered html from the database and render it on the fly. In another step, we will use some proper caching method to cache this stuff. This commit affects the User.bio_html part.
* Fix copyright statements; add LICENSE for EXIF.pyWill Kahn-Greene2012-02-081-1/+1
|
* Let some code support "media without slug"Elrond2012-01-281-12/+9
| | | | | | | | | | | | | | The upcoming SQL database will allow having media without a slug again. This might especially be useful for API support, where the uploaded image (media) does not have *any* information to generate a slug from. This code change mostly allows the sql backend to have no slug in its model and improves some parts to properly handle that. It specifically does not have any web frontend support to edit/create MediaEntries with no slug.
* License "all rights reserved" default should be None/NULL, not empty stringChristopher Allan Webber2012-01-211-1/+1
|
* Moved get_license_data to mixin.py, added license to sql media model, added ↵Aaron Williamson2012-01-181-1/+5
| | | | translation tags to license template.
* Fix url_for_self mixupElrond2012-01-111-3/+5
| | | | | Move changes from mongo/models:url_for_self back into mixin:url_for_self.
* Add DB Mixin classes and use themElrond2012-01-081-0/+90
A bunch of functions on the db objects are really more like "utility functions": They could live outside the classes and be called "by hand" passing the appropiate reference. They usually only use the public API of the object and rarely use database related stuff. Goals: - First, simple: Share the code with the SQL objects, so that the code doesn't need to be duplicated. - Second, it might unclutter the db models and make them more into "model only" stuff. - Doesn't really hurt.