From ac8212fe657802eaf9dfd9d6c0f28f25b750399e Mon Sep 17 00:00:00 2001 From: Elrond Date: Sun, 23 Dec 2012 21:44:05 +0100 Subject: [PATCH] Remove mongo style .id = ObjectId() On SQL we can't generate the primary key on our own. So just remove this stuff. --- mediagoblin/plugins/api/views.py | 2 -- mediagoblin/submit/views.py | 4 ---- 2 files changed, 6 deletions(-) diff --git a/mediagoblin/plugins/api/views.py b/mediagoblin/plugins/api/views.py index 4c36d110..d3cef432 100644 --- a/mediagoblin/plugins/api/views.py +++ b/mediagoblin/plugins/api/views.py @@ -25,7 +25,6 @@ from werkzeug.utils import secure_filename from werkzeug.wrappers import Response from celery import registry -from mediagoblin.db.util import ObjectId from mediagoblin.decorators import require_active_login from mediagoblin.processing import mark_entry_failed from mediagoblin.processing.task import ProcessMedia @@ -61,7 +60,6 @@ def post_entry(request): media_type, media_manager = sniff_media(media_file) entry = request.db.MediaEntry() - entry.id = ObjectId() entry.media_type = unicode(media_type) entry.title = unicode(request.form.get('title') or splitext(media_file.filename)[0]) diff --git a/mediagoblin/submit/views.py b/mediagoblin/submit/views.py index 1f0e927e..b52fca33 100644 --- a/mediagoblin/submit/views.py +++ b/mediagoblin/submit/views.py @@ -29,7 +29,6 @@ _log = logging.getLogger(__name__) from werkzeug.utils import secure_filename from werkzeug.datastructures import FileStorage -from mediagoblin.db.util import ObjectId from mediagoblin.tools.text import convert_to_tag_list_of_dicts from mediagoblin.tools.translate import pass_to_ugettext as _ from mediagoblin.tools.response import render_to_response, redirect @@ -66,7 +65,6 @@ def submit_start(request): # create entry and save in database entry = request.db.MediaEntry() - entry.id = ObjectId() entry.media_type = unicode(media_type) entry.title = ( unicode(request.form['title']) @@ -193,10 +191,8 @@ def add_collection(request, media=None): if request.method == 'POST' and submit_form.validate(): try: collection = request.db.Collection() - collection.id = ObjectId() collection.title = unicode(request.form['title']) - collection.description = unicode(request.form.get('description')) collection.creator = request.user.id collection.generate_slug() -- 2.25.1