aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/mongo
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch ↵Joar Wandborg2012-06-102-0/+12
|\ | | | | | | | | | | | | 'is_derek/bug405_email_notifications_for_comments' into notifications-merge Conflicts: mediagoblin/db/mongo/migrations.py
| * Merge branch 'master' into derek-moore-bug405_email_notifications_for_commentsChristopher Allan Webber2012-03-182-0/+22
| |\ | | | | | | | | | | | | Conflicts: mediagoblin/db/mongo/migrations.py
| * | These are changes for issue #405, add email comment notification.Derek Moore2012-03-152-0/+11
| | |
* | | Drop debug from migration.Elrond2012-03-251-2/+0
| | |
* | | Migration fixup: Drop empty exif_all.Elrond2012-03-251-1/+7
| | | | | | | | | | | | | | | If the exif info is totally empty, do not add it at all to the media_data dict in mongo.
* | | Create migration to move exif data around in media_data.Elrond2012-03-251-0/+25
| | | | | | | | | | | | | | | | | | Move media_data['exif']['clean'] to media_data['exif_all'] drop media_data['exif']['useful'] drop media_data['exif']
* | | Create load_models().Elrond2012-03-201-0/+4
| |/ |/| | | | | | | | | | | | | | | | | | | | | So all models are ready when connecting to the db and so our "db" object has all models listed on it, create a function to load all models from the media_types, etc. Call it in setup_database() Problem: This gives celery warnings, because celery is imported before being setup properly. No idea how to fix this now. So media-type loading is excluded from load_models for now.
* | Removing print statements from convert_gps_media_data migrationChristopher Allan Webber2012-03-181-2/+0
| | | | | | | | | | | | Kind of useful to see but... I don't think they're needed, and I'm not super comfortable with print statements being in migrations. Seems semi bloated!
* | Create function to search media by slug.Elrond2012-03-161-0/+6
| | | | | | | | | | | | | | | | | | Searching media by slug is easy on mongo. But doing the joins in sqlalchemy is not as nice. So created a function for doing it. Well, and create the same function for mongo, so that it also works.
* | Migration to move gps data aroundElrond2012-03-141-0/+18
|/ | | | | Move media_data["gps"]["*"] to media_data["gps_*"]. In preparation for media_data.gps_*
* Generic generate_slug for mongo and sql.Elrond2012-03-071-11/+0
| | | | | | | | | | 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".
* Generic check_media_slug_used db utility.Elrond2012-03-051-0/+9
| | | | | | | | In two cases (generating a new slug and editing the slug) it is nice to know in advance (before the db gets angry) that the slug is used/free. So created a db utility function to check for this on mongo and sql: check_media_slug_used()
* Create atomic_update db utility functionElrond2012-03-041-0/+11
| | | | | | | | | In some cases (notably the mark_entry_failed function) it is useful to have atomic update functionality on the db. On mongo this requires special syntax. So created an atomic_update function for mongo and started to use it in mark_entry_failed.
* Video media_data: Change layout in the mongo worldElrond2012-03-012-0/+17
| | | | | | | | | Change the media_data for video from entry.media_data["video"] to use entry.media_data directly. Also start a bare MediaEntry.media_data_init(**kwargs) method for setting up the media_data and possibly initialising it with kwargs.
* Allow .id instead of ._id for the Mongo backendElrond2012-02-251-0/+15
| | | | | | | | | | To allow easier migration to the SQLAlchemy style .id give the User and MediaEntry mongo classes an alias attribute of .id that maps to ['_id']. Use it in the upload process, because this was one of the last positions with a ['_id'] instead of ._id (due to a bug in mongokit).
* Drop pre-rendered html: MediaComment.content_htmlElrond2012-02-182-6/+9
| | | | | | | | | | | 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-182-10/+14
| | | | | | | | | | | 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-182-2/+11
| | | | | | | | | | | 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.
* It's 2012 all up in hereChristopher Allan Webber2012-02-026-6/+6
|
* License "all rights reserved" default should be None/NULL, not empty stringChristopher Allan Webber2012-01-211-1/+1
|
* Added migration for license field, resolved conflict in db/sql/models.pyAaron Williamson2012-01-191-0/+7
|\
* | Moved get_license_data to mixin.py, added license to sql media model, added ↵Aaron Williamson2012-01-181-5/+1
| | | | | | | | translation tags to license template.
* | Fixed a syntax error in edit/views and added back in some missing license ↵Aaron Williamson2012-01-171-1/+8
| | | | | | | | stuff from models
* | Fixed merge with upstreamAaron Williamson2012-01-171-106/+47
| |
* | Merged changes with upstreamAaron Williamson2012-01-171-47/+106
|/
* Fix url_for_self mixupElrond2012-01-111-21/+0
| | | | | Move changes from mongo/models:url_for_self back into mixin:url_for_self.
* Merge branch 'master' of gitorious.org:mediagoblin/mediagoblinChristopher Allan Webber2012-01-101-40/+4
|\ | | | | | | | | Conflicts: mediagoblin/db/mongo/models.py
| * Add DB Mixin classes and use themElrond2012-01-081-59/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fixed #724 and added extra infos to the atom feed (author uri and links to ↵Michele Azzolari2012-01-101-3/+5
|/ | | | the html version of each entry)
* Import MigrationManager from mongo in mongo backend.Elrond2012-01-041-1/+1
| | | | | | Inside the mongo db backend, use the mongo MigrationManager. This is hopefully the last reference to the generic MigrationManager reference on db.util.
* Factor out check_db_migrations_currentElrond2012-01-011-0/+23
| | | | | | | | | | When initializing the database connection the current mongo based setup checked for new migrations and warned about them. This was mongo specific so factor'd it out into a more generic check_db_migrations_current function in the mongo backend. Also created a dummy one in the sql backend.
* Turn media.get_uploader into a propertyElrond2011-12-271-1/+2
| | | | | | | sqlalchemy gives autoloading (hopefully caching) link to other objects as properties. So turn get_uploader on the current mongo based stuff into a property to ease transition.
* Use media.url_for_self instead of calling urlgen directlyElrond2011-12-271-8/+4
| | | | | | | | | Replace urlgen('ID', user=media.get_uploader().username, media=media.*) by media.url_for_self(urlgen) in a few places. It's just a lot nicer!
* Move verification key generation to viewElrond2011-12-271-2/+0
| | | | | | | | Instead of creating the email verication key on the db model as a default for the field, create it in the registration view. Now all verification key generation is only in auth/views.py!
* Turn MediaComment's author() into get_author propertyElrond2011-12-231-1/+2
| | | | | | | | | 1) MediaComment's author method conflicts with the author field. So rename it to get_author. 2) Turn it from a normal function into a python property. That means you call it by ".get_author" not by ".get_author()". This is exactly what sqlalchemy gives us free of charge.
* Move db/models.py -> db/mongo/models.pyElrond2011-12-202-1/+364
| | | | | To my surprise, there was only ONE reference to models.py. From open.py.
* Move db/migrations.py -> db/mongo/migrations.pyElrond2011-12-201-0/+110
| | | | And change references.
* Move db/util.py -> db/mongo/util.pyElrond2011-12-201-0/+292
| | | | | - Change some reference - Provide a wrapper db/util.py
* Move db/indexes.py to db/mongo/indexes.pyElrond2011-12-201-0/+146
| | | | And change references (one!).
* Move db/open.py to db/mongo/open.pyElrond2011-12-202-0/+70
Starting to move the mongo specific stuff into db/mongo. And create thin "from db.mongo.Y import z" wrappers in db/Y.py. Why? 1) Will make it lots easier to switch to sql for testing/developing. 2) The mongo stuff needs to stay around after moving to sql, because the converter needs it.