1880 Commits

Author SHA1 Message Date
Christopher Allan Webber
9dcd8436a9 Fixing manual tyop: MediaGoblin, not MediaGobiin (thanks gandaro!) 2012-03-18 14:39:35 -05:00
Christopher Allan Webber
54477b4d76 Removing print statements from convert_gps_media_data migration
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!
2012-03-18 12:07:41 -05:00
Elrond
7bf819a995 Let convert_mongo_to_sql add Migration Records
The mongosql tool is really dumping directly into the sql
database and is trying not to use too much logic that might
change later.

So this means, it needs to create the migration records on
its own!
So add a bunch of records with version=0.
2012-03-17 23:45:29 +01:00
Christopher Allan Webber
16fca040d5 Merge remote-tracking branch 'brett/bug264-delete-comments-with-media' 2012-03-17 17:18:15 -05:00
Christopher Allan Webber
2011f2d89e Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin 2012-03-17 17:09:26 -05:00
Christopher Allan Webber
9e55431143 mongo->sql conversion script now runs mongo migrations first, just in case 2012-03-17 17:08:46 -05:00
Jef van Schendel
327a1bb279 Remove sidedata class from html pages 2012-03-17 22:58:33 +01:00
Christopher Allan Webber
4a250dbdde Also ignore the /share/ directory 2012-03-17 16:57:18 -05:00
Jef van Schendel
4c417c59b3 Small styling change for sidebar data 2012-03-17 22:56:25 +01:00
Christopher Allan Webber
2f5ce68c6c Make mediagoblin SQL models all use a consistent table naming scheme 2012-03-17 16:56:23 -05:00
Brett Smith
a0a7f87f62 When media is deleted, delete associated comments too.
The actual code is just a simple for loop; there might be a better
implementation but this is a fine start.  I also extended test_delete to
check this too.
2012-03-17 17:53:00 -04:00
Christopher Allan Webber
431811eb36 Mongosql imports made celery get set up before we wanted it via ./bin/gmg commands
Just moved the import into the actual function.  That resolved the issue!
2012-03-17 12:31:11 -05:00
Elrond
416b439fc8 More/better translation.
- Try to preserve some translations (somehow).
- Mark "Tagged with" again for translation.
- Do not translate the empty string
2012-03-17 13:18:43 +01:00
Jef van Schendel
7e5a5acd5a Small formatting changes to footer text. 2012-03-16 23:05:30 +01:00
Elrond
07163593ee 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.
2012-03-16 21:20:14 +01:00
Elrond
d8409c26a0 Fix for mongo.
pymongo does not rewind a cursor after leaving a for loop.
So let us do it by hand. Well.
2012-03-16 21:20:14 +01:00
Elrond
1eff10fa0f 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.
2012-03-16 21:20:14 +01:00
Elrond
1b4d9edaef Fix _get_tag_name_from_entries().
Replace == by =.
2012-03-16 21:19:25 +01:00
Elrond
497d927983 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.
2012-03-15 12:38:09 +01:00
Elrond
729424befd 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).
2012-03-15 12:35:58 +01:00
Christopher Allan Webber
007ac2e720 Implemented the MediaEntry .media_data type fields for SQL 2012-03-14 18:28:06 -05:00
Christopher Allan Webber
956335c839 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.
2012-03-14 16:03:09 -05:00
Christopher Allan Webber
d87ed21ac4 Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin 2012-03-14 16:00:53 -05:00
Christopher Allan Webber
0e93443f59 ipython support in ./bin/gmg shell! 2012-03-14 16:00:34 -05:00
Elrond
36ccc57bea Add gps_altitude and gps_direction to image media_data. 2012-03-14 21:17:50 +01:00
Elrond
28306810c5 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.
2012-03-14 21:17:07 +01:00
Elrond
ea200c32ac 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.
2012-03-14 20:17:49 +01:00
Elrond
e0b2b245fe 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.
2012-03-14 20:17:49 +01:00
Elrond
ca722c3caf Migration to move gps data around
Move media_data["gps"]["*"] to media_data["gps_*"].
In preparation for media_data.gps_*
2012-03-14 20:17:49 +01:00
Christopher Allan Webber
dc84dbee7f Merge branch 'elrond-sql-convert_video_data' 2012-03-14 14:04:05 -05:00
Christopher Allan Webber
4a86335157 Fix VideoData insertion 2012-03-14 14:03:49 -05:00
Christopher Allan Webber
e5fce8a50c Preserve existing translation 2012-03-14 12:44:19 -05:00
Christopher Allan Webber
ff6933fa4c Provide a source link so we can comply with the AGPL 2012-03-14 12:38:55 -05:00
Elrond
ef7de98ad5 Convert media_data for video
This creates fresh VideoData rows for all the videos in the
mongodb.
2012-03-13 23:08:34 +01:00
Christopher Allan Webber
19e67f5955 Merge remote-tracking branch 'refs/remotes/chemhacker/bug402_nicer_skin_for_video'
Conflicts:
	mediagoblin/templates/mediagoblin/media_displays/video.html
2012-03-13 15:40:59 -05:00
Sacha De'Angeli
560e22e7d2 adding the video.js wrapper 2012-03-12 19:44:55 -05:00
Christopher Allan Webber
849cf91fc8 Merge branch 'master' of gitorious.org:mediagoblin/mediagoblin 2012-03-12 18:38:35 -05:00
Elrond
cc9f9a1dd3 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.
2012-03-13 00:19:53 +01:00
Christopher Allan Webber
1f36e6bee9 Merge remote-tracking branch 'derek-moore/bug293_non_ascii_password' 2012-03-12 18:19:03 -05:00
Derek Moore
20a3e278bc Changes for 293. Tests pass, encode UTF8 on password on registration (and also for subsequent logins once the user is created) is working. 2012-03-12 16:02:42 -07:00
Elrond
84812db59d 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.
2012-03-12 23:46:04 +01:00
Elrond
dd0799ad0a 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.
2012-03-12 21:21:35 +01:00
Sacha De'Angeli
4badfd9317 adds video preload bug 375 2012-03-12 14:57:31 -05:00
Christopher Allan Webber
8bc894e82b Added m4v to list of media types and a comment stating we should
autogenerate extension list
2012-03-12 13:38:22 -05:00
Jef van Schendel
fcc0f4e81d Slight change to thumbnail gallery style 2012-03-11 00:03:50 +01:00
Elrond
193e0f5346 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.
2012-03-10 22:48:24 +01:00
Elrond
3c7d451c71 Forgot to add FileKeynames to MODELS 2012-03-08 21:18:17 +01:00
Elrond
a9dac7c83d 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.
2012-03-08 21:11:18 +01:00
Joar Wandborg
703d09b985 Changed from key-notation to dot-notation in edit_profile 2012-03-08 01:02:40 +01:00
Joar Wandborg
4dbf16be33 SQL: Added MediaFile and MediaAttachmentFile to MODELS 2012-03-08 01:02:06 +01:00