Wednesday, June 25, 2014

Re: Using session data to populate multiple forms

haha - okay

model_instance.participant = request.session.get('participant')

works perfectly.

I thought the incorrect use of objects was just the start :)

Thanks Daniel, much appreciated.


On Wednesday, 25 June 2014 11:07:19 UTC+2, Daniel Roseman wrote:
On Wednesday, 25 June 2014 08:58:05 UTC+1, Aaron Reabow wrote:
Perhaps I should be more specific.

How do i populate some fields in a table from a form, and other fields from session variables in the view  (or the template or the model if that was more appropriate)

many thanks,

aaron


Well, I understand that bit. What I don't understand is what's wrong with the code you've posted, once you correct the use of dictionary syntax?  This is exactly the correct approach.
--
DR.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4e2efcb1-bb19-491d-9db4-7792f359474a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment