On Fri, Aug 17, 2012 at 1:28 PM, Sandeep kaur <mkaurkha...@gmail.com> wrote:
> I am using session foreign key in my table.

>          if not request.session.exists(request.session.session_key):
>                                 request.session.create()
>          profile.sess = request.session.session_key
>          profile.save()
>
> But when I execute my form and click on submit button, I get error as :
>
> ```Cannot assign "'b593c61453d7aad199078c66b9ad6b30'":
> "ClientJob.sess" must be a "Session" instance.````
>

Problem solved!!
Used this code :

if not request.session.exists(request.session.session_key):
        request.session.create()
profile.sess = Session.objects.get(session_key=request.session.session_key)

-- 
Sandeep Kaur
E-Mail: mkaurkha...@gmail.com
Blog: sandymadaan.wordpress.com

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

Reply via email to