List Info

Thread: user.get_profile()




user.get_profile()
country flaguser name
United States
2007-02-28 11:26:37
Dear All,

I have a view method that looks like this:

login_required
def viewprofile(request):
    uname = request.user.username
    profile = request.user.get_profile()
    return HttpResponse(uname)

I have a models.py file that includes:

class MySiteProfile(models.Model):
    user = models.ForeignKey(User, unique=True)
    doneQuestions = models.ForeignKey(Question)

And I get an error:

ValueError at /accounts/profile/
too many values to unpack
Request Method: 	GET
Request URL: 	http://localh
ost:8000/accounts/profile/
Exception Type: 	ValueError
Exception Value: 	too many values to unpack
Exception Location:
	/usr/lib/python2.4/site-packages/Django-0.95-
py2.4.egg/django/contrib/auth/models.py in get_profile, line
245

Any pointers as to what is happening ?

Thanks,
Matt


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: user.get_profile()
user name
2007-02-28 14:12:09
On 2/28/07, MattW <matthew.williamscancer.org.uk> wrote:
>
> Dear All,
>
> I have a view method that looks like this:

I think you need the SVN version of Django, as they
suggested to you
in the other thread about user authentication

-- 
Lawrence, oluyede.org - neropercaso.it
"It is difficult to get a man to understand
something when his salary depends on not
understanding it" - Upton Sinclair

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )