I realize that there are much more elegant ways to do this, and I will get there, but this is just hacking around trying to make it all work first. I’ve gotten this error:
SyntaxError at
/accounts/profile/foobar/
keyword can’t be an expression (views.py, line 104)
and here is the corresponding line. Note: keyword is a string that I pass in the URL and I use it to look up the user.
user = User.objects.get(username=keyword)
up = UserProfile(user=user.id,
fullname=result['fullname'],
email=result['email'],
phone=result['phone'],
title=result['title'],
department=result['department'],
office=result['office'])
Am I not mapping the UserProfile object to the User object correctly? What’s the proper way to add in a foreign key — simply pass the object itself? Insight and wisdom appreciated.
Easily duplicated:
The error message is a bit cryptic – where’s the keyword? I suspect its to do with ‘.’ being syntax for getattr.