Dot-Notation: x._id = ObjectId() doesn't seem to work properly

For whatever reason, this does not work as expected:
	entry._id = ObjectId()
Need to go this way:
	entry['_id'] = ObjectId()
This commit is contained in:
Elrond 2011-11-14 17:11:37 +01:00
parent eabe6b678a
commit 3618a9ac51

View File

@ -52,7 +52,7 @@ def submit_start(request):
# create entry and save in database
entry = request.db.MediaEntry()
entry._id = ObjectId()
entry['_id'] = ObjectId()
entry['title'] = (
unicode(request.POST['title'])
or unicode(splitext(filename)[0]))