Hello again,
here is a code example. Hope someone could help me
-------------------------------------------------------------------------------------
from otherfile import test
@transaction.commit_manually
def view(request, secid):
result = {'status': 'OK', 'msg': None}
try:
reserv = UserReservation.objects.get(secure_id=secid)
except UserReservation.DoesNotExist:
result['status'] = u'RESERVATION_NOTFOUND'
else:
try:
user = User.objects.get(email=reserv.email)
except User.DoesNotExist:
try:
user = User.objects.create_user(
username=registration.create_username(),
email=reserv.email, password=None)
profile = UserProfile(user=user,
birthday=reserv.birthday)
user.save()
profile.save()
except:
result['status'] = 'ERROR_SAVE_USER'
else:
result['status'] = 'OK'
else:
try:
user.first_name = reserv.first_name
user.save()
except:
result['status'] = 'ERROR_SAVE_USER'
else:
result['status'] = 'OK'
finally:
if result['status'] == 'OK':
otherfile.test()
reserv.delete()
transaction.commit()
else:
transaction.rollback()
return render_to_response('template.html', {'result':result})
------------------------------------------------------------------------------------
otherfile.py
def test():
test = {status: 'OK', 'msg': None}
-------------------------------------------------------------------------------------
And here is the Traceback-Link: http://dpaste.com/35648/
The error appears only if I define a dictionary in test(). If I write
"None" the view works well.
Regards
Bernd
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---