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).
This commit is contained in:
@@ -59,7 +59,7 @@ def submit_start(request):
|
||||
|
||||
# create entry and save in database
|
||||
entry = request.db.MediaEntry()
|
||||
entry['_id'] = ObjectId()
|
||||
entry.id = ObjectId()
|
||||
entry.media_type = unicode(media_type)
|
||||
entry.title = (
|
||||
unicode(request.POST['title'])
|
||||
|
||||
Reference in New Issue
Block a user