mediagoblin.git
12 years agoAdd documentation to the FilenameMunger class.
Brett Smith [Sun, 25 Mar 2012 16:16:19 +0000 (12:16 -0400)]
Add documentation to the FilenameMunger class.

12 years agoAdd FilenameMunger class to processing, with tests.
Brett Smith [Sun, 25 Mar 2012 16:11:13 +0000 (12:11 -0400)]
Add FilenameMunger class to processing, with tests.

Munging filenames is something all media type processors want to be able to
do, so I'm refactoring it out into a nice bite-sized class.

12 years agoAdd tests for image processing. Check filenames and image sizes.
Brett Smith [Wed, 21 Mar 2012 03:59:28 +0000 (23:59 -0400)]
Add tests for image processing.  Check filenames and image sizes.

This test helps verify that bug #261 is actually fixed.

In order to test that all the processed images are smaller, I needed to add
an image that's bigger than processing.MEDIUM_SIZE, hence bigblue.png.

12 years agoMake a function to generate test image filenames.
Brett Smith [Wed, 21 Mar 2012 03:03:11 +0000 (23:03 -0400)]
Make a function to generate test image filenames.

12 years agoPrefer nose assert_* methods to the assert built-in.
Brett Smith [Wed, 21 Mar 2012 02:40:32 +0000 (22:40 -0400)]
Prefer nose assert_* methods to the assert built-in.

12 years agoRefactor false image tests.
Brett Smith [Wed, 21 Mar 2012 02:36:56 +0000 (22:36 -0400)]
Refactor false image tests.

12 years agoRefactor normal upload tests.
Brett Smith [Wed, 21 Mar 2012 02:30:57 +0000 (22:30 -0400)]
Refactor normal upload tests.

This is nice because it means we do *all* the normal sanity tests for *all*
the normal uploads.  check_url() can be used in other tests too.

12 years agoRefactor MediaEntry fetches/checks into check_media().
Brett Smith [Wed, 21 Mar 2012 02:16:28 +0000 (22:16 -0400)]
Refactor MediaEntry fetches/checks into check_media().

12 years agoRefactor data posts into one do_post function.
Brett Smith [Wed, 21 Mar 2012 02:07:32 +0000 (22:07 -0400)]
Refactor data posts into one do_post function.

All the data posts in these tests had a lot of common code.  Putting all
that into a function makes it easier to write more tests (which I'll be
doing in a bit) and see what's really being tested.

12 years agosmall readability improvements in resize_image
Brett Smith [Sun, 18 Mar 2012 13:35:14 +0000 (09:35 -0400)]
small readability improvements in resize_image

12 years agoRefactor image resize code, with better filenames (#261)
Brett Smith [Sun, 18 Mar 2012 03:43:46 +0000 (23:43 -0400)]
Refactor image resize code, with better filenames (#261)

The code to make thumbnail- and medium-sized images in processing.py is
pretty similar, so I rolled that out into a separate function that we call
with different arguments as appropriate.

The new function should work identically to the old code, except it saves
images with filenames based on the original filename, like
`foobar.medium.jpg` instead of just `medium.jpg`.  This fixes bug #261.

12 years agoMore/better translation.
Elrond [Sat, 17 Mar 2012 12:18:43 +0000 (13:18 +0100)]
More/better translation.

- Try to preserve some translations (somehow).
- Mark "Tagged with" again for translation.
- Do not translate the empty string

12 years agoSmall formatting changes to footer text.
Jef van Schendel [Fri, 16 Mar 2012 22:05:30 +0000 (23:05 +0100)]
Small formatting changes to footer text.

12 years agoCreate function to search media by slug.
Elrond [Fri, 16 Mar 2012 17:13:46 +0000 (18:13 +0100)]
Create function to search media by slug.

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.

12 years agoFix for mongo.
Elrond [Fri, 16 Mar 2012 19:59:44 +0000 (20:59 +0100)]
Fix for mongo.

pymongo does not rewind a cursor after leaving a for loop.
So let us do it by hand. Well.

12 years agoMore efficient first element fetching and Dot-Notation.
Elrond [Fri, 16 Mar 2012 16:57:27 +0000 (17:57 +0100)]
More efficient first element fetching and Dot-Notation.

_get_tag_name_from_entries:
1) Replace:
     if q.count():
       elem = q[0]
   by:
     for element in q:
       ...
       break

   this doesn't do two db queries but only one.

2) And another dose of Dot-Notation as usual.

12 years agoFix _get_tag_name_from_entries().
Elrond [Fri, 16 Mar 2012 20:18:04 +0000 (21:18 +0100)]
Fix _get_tag_name_from_entries().

Replace == by =.

12 years agoFix uploading of images (sql: media_data, exif).
Elrond [Thu, 15 Mar 2012 11:38:09 +0000 (12:38 +0100)]
Fix uploading of images (sql: media_data, exif).

When uploading a new image the processing code wants to set
the media_data['exif'] part. As exif is not yet in sql,
there is no way to make this work now. So the workaround is
to check for "no row exists yet" and just ignore exif.

12 years agoFix media display for no media_data row in sql.
Elrond [Thu, 15 Mar 2012 11:35:58 +0000 (12:35 +0100)]
Fix media display for no media_data row in sql.

If there is no media_data row for the current media (for
whatever reason, there might be good ones), let
MediaEntry.media_data not raise an exception but just
return None.

The exif display part now handles this by checking whether
.media_data.exif is defined (None has no attribute exif, so
it's undefined, all fine).

12 years agoImplemented the MediaEntry .media_data type fields for SQL
Christopher Allan Webber [Wed, 14 Mar 2012 23:28:06 +0000 (18:28 -0500)]
Implemented the MediaEntry .media_data type fields for SQL

12 years agoRemoving an unnecessary line of whitespace AND crediting Hugo Boyer for the ipython...
Christopher Allan Webber [Wed, 14 Mar 2012 21:03:09 +0000 (16:03 -0500)]
Removing an unnecessary line of whitespace AND crediting Hugo Boyer for the ipython code!

Thanks Hugo Boyer!  I forgot to credit you in my last commit.

12 years agoMerge branch 'master' of gitorious.org:mediagoblin/mediagoblin
Christopher Allan Webber [Wed, 14 Mar 2012 21:00:53 +0000 (16:00 -0500)]
Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin

12 years agoipython support in ./bin/gmg shell!
Christopher Allan Webber [Wed, 14 Mar 2012 21:00:34 +0000 (16:00 -0500)]
ipython support in ./bin/gmg shell!

12 years agoAdd gps_altitude and gps_direction to image media_data.
Elrond [Wed, 14 Mar 2012 20:17:50 +0000 (21:17 +0100)]
Add gps_altitude and gps_direction to image media_data.

12 years agoConvert (gps) image media_data.
Elrond [Wed, 14 Mar 2012 20:17:07 +0000 (21:17 +0100)]
Convert (gps) image media_data.

Add mongo_to_sql convert part for converting the media_data
for images. This currently drops the exif data and thus
only converts gps data.

12 years agoChange image processing to create new .gps_*.
Elrond [Wed, 14 Mar 2012 19:15:04 +0000 (20:15 +0100)]
Change image processing to create new .gps_*.

The processing should also create .gps_* instead of the old
['gps']['x']. To ease forward porting, use the new
media.media_data_init() to set the gps data in the media.

12 years agoUse .gps_* in the template and add translations.
Elrond [Wed, 14 Mar 2012 19:13:42 +0000 (20:13 +0100)]
Use .gps_* in the template and add translations.

Instead of .gps.x use .gps_x and add some "is defined" and
stuff.

Also mark some strings for translation in here.

12 years agoMigration to move gps data around
Elrond [Wed, 14 Mar 2012 18:35:48 +0000 (19:35 +0100)]
Migration to move gps data around

Move media_data["gps"]["*"] to media_data["gps_*"].
In preparation for media_data.gps_*

12 years agoMerge branch 'elrond-sql-convert_video_data'
Christopher Allan Webber [Wed, 14 Mar 2012 19:04:05 +0000 (14:04 -0500)]
Merge branch 'elrond-sql-convert_video_data'

12 years agoFix VideoData insertion
Christopher Allan Webber [Wed, 14 Mar 2012 19:03:49 +0000 (14:03 -0500)]
Fix VideoData insertion

12 years agoPreserve existing translation
Christopher Allan Webber [Wed, 14 Mar 2012 17:44:19 +0000 (12:44 -0500)]
Preserve existing translation

12 years agoProvide a source link so we can comply with the AGPL
Christopher Allan Webber [Wed, 14 Mar 2012 17:38:55 +0000 (12:38 -0500)]
Provide a source link so we can comply with the AGPL

12 years agoConvert media_data for video
Elrond [Tue, 13 Mar 2012 22:03:03 +0000 (23:03 +0100)]
Convert media_data for video

This creates fresh VideoData rows for all the videos in the
mongodb.

12 years agoMerge remote-tracking branch 'refs/remotes/chemhacker/bug402_nicer_skin_for_video'
Christopher Allan Webber [Tue, 13 Mar 2012 20:40:59 +0000 (15:40 -0500)]
Merge remote-tracking branch 'refs/remotes/chemhacker/bug402_nicer_skin_for_video'

Conflicts:
mediagoblin/templates/mediagoblin/media_displays/video.html

12 years agoadding the video.js wrapper
Sacha De'Angeli [Tue, 13 Mar 2012 00:44:55 +0000 (19:44 -0500)]
adding the video.js wrapper

12 years agoMerge branch 'master' of gitorious.org:mediagoblin/mediagoblin
Christopher Allan Webber [Mon, 12 Mar 2012 23:38:35 +0000 (18:38 -0500)]
Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin

12 years agoAnother .one -> .find_one
Elrond [Mon, 12 Mar 2012 23:17:06 +0000 (00:17 +0100)]
Another .one -> .find_one

Same idea as in the previous commit.
Joar caught this one.

To reproduce
1. Create a user with an all-decimal ObjectId in mongo
2. Login using that user, while mongodb is enabled.
3. Switch instance to sql.
4. Restart.
5. Refresh any page.

This will error, because no user with that object id exists
any more.

While around, improved logging.

12 years agoMerge remote-tracking branch 'derek-moore/bug293_non_ascii_password'
Christopher Allan Webber [Mon, 12 Mar 2012 23:19:03 +0000 (18:19 -0500)]
Merge remote-tracking branch 'derek-moore/bug293_non_ascii_password'

12 years agoChanges for 293. Tests pass, encode UTF8 on password on registration (and also for...
Derek Moore [Mon, 12 Mar 2012 23:02:42 +0000 (16:02 -0700)]
Changes for 293.  Tests pass, encode UTF8 on password on registration (and also for subsequent logins once the user is created) is working.

12 years agoChange user search from .one to .fine_one.
Elrond [Fri, 27 Jan 2012 23:24:09 +0000 (00:24 +0100)]
Change user search from .one to .fine_one.

When searching for a user by username, there can either be
no result or one result. There is a unique constraint on
the db.

.one in mongokit raises an error for more than one result.
But that can't happen anyway. So no problem.

.one in sqlalchemy raises an error for more than one, but
that's not a problem anyway. It also raises an error for no
result. But no result is handled by the code anyway, so no
need to raise an exception.

.find_one doesn't raise an exception for more than one
result (no problem anyway) and just returns None for no
result. The later is handled by the code.

12 years agoBetter media_data sql table for images.
Elrond [Sat, 10 Mar 2012 20:01:45 +0000 (21:01 +0100)]
Better media_data sql table for images.

1. Change to the current primary key = media_entry id
   layout
2. Add gps_{latitude,longitude} to the table.

12 years agoadds video preload bug 375
Sacha De'Angeli [Mon, 12 Mar 2012 19:57:31 +0000 (14:57 -0500)]
adds video preload bug 375

12 years agoAdded m4v to list of media types and a comment stating we should
Christopher Allan Webber [Mon, 12 Mar 2012 18:38:22 +0000 (13:38 -0500)]
Added m4v to list of media types and a comment stating we should
autogenerate extension list

12 years agoSlight change to thumbnail gallery style
Jef van Schendel [Sat, 10 Mar 2012 23:03:50 +0000 (00:03 +0100)]
Slight change to thumbnail gallery style

12 years agoImprove logging of sql queries a bit.
Elrond [Sat, 10 Mar 2012 21:34:06 +0000 (22:34 +0100)]
Improve logging of sql queries a bit.

Docs:
  http://docs.sqlalchemy.org/en/latest/core/engines.html#configuring-logging

So for an application utilizing python logging for real
(and MediaGoblin should) the rule is:
- Don't use echo=True,
- but reconfigure the appropiate loggers' level.

So replaced the echo=True by a line to reconfigure the
appropiate logger to achieve the same effect.

This still dumps whole bloats of SQL queries into the main
log, but at least they're not duped any more.

12 years agoForgot to add FileKeynames to MODELS
Elrond [Wed, 7 Mar 2012 23:14:45 +0000 (00:14 +0100)]
Forgot to add FileKeynames to MODELS

12 years agoNormalize MediaFile.name (make it a foreignkey)
Elrond [Fri, 24 Feb 2012 20:16:02 +0000 (21:16 +0100)]
Normalize MediaFile.name (make it a foreignkey)

The name part of a MediaFile is only using a very limited
number of items. Currently things like "original" or
"thumb".

So instead of storing the string on each entry, just store
a short integer referencing the FileKeynames table and have
the appropiate string there.

12 years agoChanged from key-notation to dot-notation in edit_profile
Joar Wandborg [Thu, 8 Mar 2012 00:02:40 +0000 (01:02 +0100)]
Changed from key-notation to dot-notation in edit_profile

12 years agoSQL: Added MediaFile and MediaAttachmentFile to MODELS
Joar Wandborg [Thu, 8 Mar 2012 00:02:06 +0000 (01:02 +0100)]
SQL: Added MediaFile and MediaAttachmentFile to MODELS

12 years agoGeneric generate_slug for mongo and sql.
Elrond [Sun, 19 Feb 2012 11:14:13 +0000 (12:14 +0100)]
Generic generate_slug for mongo and sql.

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".

12 years agoPush another half-fix for portrait thumbnails. Man, this thing is breaking all over...
Jef van Schendel [Wed, 7 Mar 2012 15:29:02 +0000 (16:29 +0100)]
Push another half-fix for portrait thumbnails. Man, this thing is breaking all over the place.

12 years agoSort-of fixes so the header does not collapse anymore. Header needs redesigning.
Jef van Schendel [Wed, 7 Mar 2012 15:24:23 +0000 (16:24 +0100)]
Sort-of fixes so the header does not collapse anymore. Header needs redesigning.

12 years agoHeader doesn't need a height
Jef van Schendel [Wed, 7 Mar 2012 15:17:21 +0000 (16:17 +0100)]
Header doesn't need a height

12 years agoActually decrease thumbnail size instead of just their containers
Jef van Schendel [Wed, 7 Mar 2012 15:11:24 +0000 (16:11 +0100)]
Actually decrease thumbnail size instead of just their containers

12 years agoTranslate less html.
Elrond [Tue, 6 Mar 2012 13:49:42 +0000 (14:49 +0100)]
Translate less html.

Instead of translating <p ...>TEXT</p> just mark TEXT for
translation. That way formatting changes can be done
without affecting the translations.

12 years agoMerge branch 'master' of gitorious.org:mediagoblin/mediagoblin
Jef van Schendel [Mon, 5 Mar 2012 23:36:15 +0000 (00:36 +0100)]
Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin

12 years agoRevert thumbnail gallery change: switch back to tables
Jef van Schendel [Mon, 5 Mar 2012 23:35:55 +0000 (00:35 +0100)]
Revert thumbnail gallery change: switch back to tables

12 years agoFix merge conflict in prev_next.html
Jef van Schendel [Mon, 5 Mar 2012 23:31:34 +0000 (00:31 +0100)]
Fix merge conflict in prev_next.html

12 years agoGeneric check_media_slug_used db utility.
Elrond [Tue, 24 Jan 2012 20:47:40 +0000 (21:47 +0100)]
Generic check_media_slug_used db utility.

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()

12 years agoSQL: Tool to cleanup unused tag slugs.
Elrond [Tue, 24 Jan 2012 22:03:33 +0000 (23:03 +0100)]
SQL: Tool to cleanup unused tag slugs.

The current SQL layout/sqlalchemy strucuture can't detect
whether a slug isn't needed any more and delete it. So
provide a tool function to cleanup unused slugs.

It's currently not hooked to any gmg function!

12 years agoStop failing if there is no previous/next to go to
Jef van Schendel [Mon, 5 Mar 2012 18:27:26 +0000 (19:27 +0100)]
Stop failing if there is no previous/next to go to

12 years agoMerge branch 'keyboard_nav'
Jef van Schendel [Mon, 5 Mar 2012 18:21:59 +0000 (19:21 +0100)]
Merge branch 'keyboard_nav'

12 years agoEdit css rule to allow users to zoom
Jef van Schendel [Mon, 5 Mar 2012 17:47:31 +0000 (18:47 +0100)]
Edit css rule to allow users to zoom

12 years agoAdded the sql_switch.py script to .gitignore
Joar Wandborg [Mon, 5 Mar 2012 16:15:43 +0000 (17:15 +0100)]
Added the sql_switch.py script to .gitignore

12 years agoImplement atomic_update for SQL.
Elrond [Sun, 12 Feb 2012 21:58:08 +0000 (22:58 +0100)]
Implement atomic_update for SQL.

On sqlalchemy most updates are atomic enough for most use
cases. Anyway, here is an atomic_update that is compatible
to the mongo version.

12 years agoCreate atomic_update db utility function
Elrond [Sun, 29 Jan 2012 19:56:51 +0000 (20:56 +0100)]
Create atomic_update db utility function

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.

12 years agoAdd sidebar again
Jef van Schendel [Sun, 4 Mar 2012 18:13:47 +0000 (19:13 +0100)]
Add sidebar again

12 years agoMerge branch 'newlayout' into newlayout-stage
Jef van Schendel [Sun, 4 Mar 2012 18:05:41 +0000 (19:05 +0100)]
Merge branch 'newlayout' into newlayout-stage

12 years agoMerge branch 'media_data_start'
Elrond [Sat, 3 Mar 2012 20:25:20 +0000 (21:25 +0100)]
Merge branch 'media_data_start'

* media_data_start:
  And media_data_init() for sql as a dummy
  Create a fake MediaEntry.media_data for sql
  Video media_data: Change layout in the mongo world

12 years agoAnd media_data_init() for sql as a dummy
Elrond [Sat, 3 Mar 2012 20:12:57 +0000 (21:12 +0100)]
And media_data_init() for sql as a dummy

Needs to be implemented.

12 years agoCreate a fake MediaEntry.media_data for sql
Elrond [Sat, 18 Feb 2012 21:20:32 +0000 (22:20 +0100)]
Create a fake MediaEntry.media_data for sql

So that the SQL backend is more useable, let the MediaEntry
have a faked media_data.
It's extremely fake: The returned dict is always a new one.
So any stored info is even lost!

12 years agoGo go mediagoblin favico symmetry
Christopher Allan Webber [Thu, 1 Mar 2012 23:30:07 +0000 (17:30 -0600)]
Go go mediagoblin favico symmetry

12 years agoVideo media_data: Change layout in the mongo world
Elrond [Thu, 1 Mar 2012 20:59:26 +0000 (21:59 +0100)]
Video media_data: Change layout in the mongo world

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.

12 years agoSQL: Improve video media_data table
Elrond [Thu, 1 Mar 2012 20:34:21 +0000 (21:34 +0100)]
SQL: Improve video media_data table

1. Make the foreignkey the primary_key.
2. Add width/height, as those are currently in use for the
   media_data

12 years agoCleanup Session after each request.
Elrond [Sat, 28 Jan 2012 12:10:01 +0000 (13:10 +0100)]
Cleanup Session after each request.

It's good practice to cleanup the SQL session after each
request so that the next request gets a fresh one.

It's an application decision whether one wants a
just-in-case ROLLBACK or COMMIT. There are two ideas behind
it, really. I have decided for ROLLBACK. The idea is "if
you forget to commit your changes yourself, there's
something broken. Maybe you got an exception?".

12 years agoAttachment support in the SQL backend
Elrond [Sat, 25 Feb 2012 22:53:11 +0000 (23:53 +0100)]
Attachment support in the SQL backend

attachments working with the sql backend.

- SQL Schema for attachment files, ordering attachments by
  their name, not by the submission order (as earlier).
- Dot-Notation for attachments, where missing.
- convert existing attachments over from mongo -> sql

12 years agoFix tests given recent celery "case" change
Christopher Allan Webber [Tue, 28 Feb 2012 19:31:03 +0000 (13:31 -0600)]
Fix tests given recent celery "case" change

12 years agoAccidentally overwrote the celery/__init__.py, fixed this and removed the upper correctly
Luke Slater [Tue, 28 Feb 2012 16:47:38 +0000 (16:47 +0000)]
Accidentally overwrote the celery/__init__.py, fixed this and removed the upper correctly

12 years agoChanged celery config keys to upper case and removed upper casing of keys when initia...
Luke Slater [Tue, 28 Feb 2012 16:40:37 +0000 (16:40 +0000)]
Changed celery config keys to upper case and removed upper casing of keys when initialising the config as per issue #214

12 years agoLet mark_entry_failed log unknown exceptions
Elrond [Sun, 19 Feb 2012 11:13:48 +0000 (12:13 +0100)]
Let mark_entry_failed log unknown exceptions

I don't know exactly why, but an exception during
processing hasn't found its way up. The entry was marked as
failed and that was it. So I decided to add a _log.warn to
the part of mark_entry_failed that handles general
exceptions.

12 years agoMerge remote-tracking branch 'cwebber/celerysql'
Elrond [Mon, 27 Feb 2012 20:55:02 +0000 (21:55 +0100)]
Merge remote-tracking branch 'cwebber/celerysql'

* cwebber/celerysql:
  Adjust unit tests to match new celery/kombu sqlalchemy setup
  "database" is not the sqlalchemy kombu transport... should be "sqlalchemy"
  Celery and kombu databases should also be .gitignore'd
  kombu-sqlalchemy a requirement in order for kombu sqlalchemy transport to work
  Move mediagoblin dbs out of user_dev for race condition directory-creation reasons.
  Give kombu its own db.  Responding to Elrond "sqlite will lock all the time!" :)
  Apparently an absolute path is three slashes after sqlite:.  Thx elrond.
  Should be all that's needed to switch celery/kombu settings to sqlalchemy

12 years agoCommitting extracted and compiled translations
Christopher Allan Webber [Sun, 26 Feb 2012 21:51:11 +0000 (15:51 -0600)]
Committing extracted and compiled translations

12 years agoCommitting present MediaGoblin translations before pushing extracted messages
Christopher Allan Webber [Sun, 26 Feb 2012 21:51:00 +0000 (15:51 -0600)]
Committing present MediaGoblin translations before pushing extracted messages

12 years agoAdjust unit tests to match new celery/kombu sqlalchemy setup
Christopher Allan Webber [Sun, 26 Feb 2012 21:45:58 +0000 (15:45 -0600)]
Adjust unit tests to match new celery/kombu sqlalchemy setup

12 years ago"database" is not the sqlalchemy kombu transport... should be "sqlalchemy"
Christopher Allan Webber [Sun, 26 Feb 2012 19:27:09 +0000 (13:27 -0600)]
"database" is not the sqlalchemy kombu transport... should be "sqlalchemy"

12 years agoCelery and kombu databases should also be .gitignore'd
Christopher Allan Webber [Sun, 26 Feb 2012 19:26:44 +0000 (13:26 -0600)]
Celery and kombu databases should also be .gitignore'd

12 years agokombu-sqlalchemy a requirement in order for kombu sqlalchemy transport to work
Christopher Allan Webber [Sun, 26 Feb 2012 19:24:49 +0000 (13:24 -0600)]
kombu-sqlalchemy a requirement in order for kombu sqlalchemy transport to work

12 years agoLet SQL objects support .setdefault() and .delete()
Elrond [Sun, 19 Feb 2012 11:14:58 +0000 (12:14 +0100)]
Let SQL objects support .setdefault() and .delete()

Some parts in the code like to use .setdefault(). So make
them happy and provide a minimal version. It ignores the
given default and expects the attribute to already exist.

Other parts use .delete() to delete a complete object. This
version expects the object to live in a session and also
does the final commit.

12 years agoDot-Notation: MediaComment and some random places
Elrond [Sun, 12 Feb 2012 22:49:37 +0000 (23:49 +0100)]
Dot-Notation: MediaComment and some random places

12 years agoLet Main Server emit startup notice including version
Elrond [Sun, 26 Feb 2012 17:45:35 +0000 (18:45 +0100)]
Let Main Server emit startup notice including version

There was no place in the software telling the user the
version in use. So start by having the main server emit a
startup notice including the version string. Uses python
logging, so should be easy to reconfigure, etc.

12 years agoMove mediagoblin dbs out of user_dev for race condition directory-creation reasons.
Christopher Allan Webber [Sun, 26 Feb 2012 14:20:17 +0000 (08:20 -0600)]
Move mediagoblin dbs out of user_dev for race condition directory-creation reasons.

12 years agoGive kombu its own db. Responding to Elrond "sqlite will lock all the time!" :)
Christopher Allan Webber [Sun, 26 Feb 2012 13:58:40 +0000 (07:58 -0600)]
Give kombu its own db.  Responding to Elrond "sqlite will lock all the time!" :)

12 years agoApparently an absolute path is three slashes after sqlite:. Thx elrond.
Christopher Allan Webber [Sun, 26 Feb 2012 13:46:23 +0000 (07:46 -0600)]
Apparently an absolute path is three slashes after sqlite:.  Thx elrond.

sqlite:///////////////////////////////////whaaaaaa.db

12 years agoShould be all that's needed to switch celery/kombu settings to sqlalchemy
Christopher Allan Webber [Sun, 26 Feb 2012 04:39:08 +0000 (22:39 -0600)]
Should be all that's needed to switch celery/kombu settings to sqlalchemy

12 years agoAllow .id instead of ._id for the Mongo backend
Elrond [Sun, 25 Dec 2011 15:01:59 +0000 (16:01 +0100)]
Allow .id instead of ._id for the Mongo backend

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).

12 years agoCreate "gmg convert_mongo_to_sql" command
Elrond [Thu, 16 Feb 2012 23:09:30 +0000 (00:09 +0100)]
Create "gmg convert_mongo_to_sql" command

Finally, to make testing of sql a bit easier, create a
bin/gmg command to do the conversion from mongo to sql.
It's currently named "convert_mongo_to_sql".

The most important option is the gmg -cf option to give a
configfile with the appropiate sql_engine definition.

12 years agomongo to sql convert: Better Ordering
Elrond [Sun, 22 Jan 2012 15:57:56 +0000 (16:57 +0100)]
mongo to sql convert: Better Ordering

Order the conversion by the "created" attribute. That way
the sql ids are mostly in the order they would have been,
if sql was used earlier.

Makes things nicer to look at in a db dump.

12 years agoUse task_id in generating the queue file path
Elrond [Sun, 19 Feb 2012 11:13:26 +0000 (12:13 +0100)]
Use task_id in generating the queue file path

The task_id is created anyway as a UUID. So it is very
unique per definition. The only thing needed for the queue
file path is a unique part.

Before the objectid of the MediaEntry was used instead. But
in the sql world the objectid is only available after an
"insert" on the db. And creating the queue_file_path
afterwards would require an "update" on the db. We can save
that. ... for now.

12 years agoForgot to add these layout changes. Everything should work now.
Jef van Schendel [Tue, 21 Feb 2012 17:09:38 +0000 (18:09 +0100)]
Forgot to add these layout changes. Everything should work now.

12 years agoResolve merge conflicts
Jef van Schendel [Tue, 21 Feb 2012 16:43:05 +0000 (17:43 +0100)]
Resolve merge conflicts