Re: trouble storing a manytomany field in a session variable

2011-02-14 Thread Shawn Milochik
On Mon, Feb 14, 2011 at 9:53 PM, Bobby Roberts wrote: > yeah i've got it where session ends on browser close so they will > refresh when they come back and log back in.  I'm just trying to find > an efficient way to store the values so that I don't have to query on > every

Re: trouble storing a manytomany field in a session variable

2011-02-14 Thread Bobby Roberts
yeah i've got it where session ends on browser close so they will refresh when they come back and log back in. I'm just trying to find an efficient way to store the values so that I don't have to query on every page. On Feb 14, 9:19 pm, Shawn Milochik wrote: > Pickling will

Re: trouble storing a manytomany field in a session variable

2011-02-14 Thread Bobby Roberts
someone can choose 1 or many locations in their profile and i'm trying to think of an interesting way to put those values from the MTM table into a session var. On Feb 14, 9:03 pm, Bobby Roberts wrote: > just wanted to clarify... i've got the manytomany setup in a user >

Re: trouble storing a manytomany field in a session variable

2011-02-14 Thread Shawn Milochik
Pickling will let you store objects as strings. However, perhaps you would like to use a memoize[1] decorator on your function. Are you trying to do this for performance reasons, because getting that relationship info from the database is slow? Regardless of why you're doing it, make sure you

Re: trouble storing a manytomany field in a session variable

2011-02-14 Thread Shawn Milochik
You can always use pickle to serialize something. What do you mean by a "many to many relationship," though? -- 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

Re: trouble storing a manytomany field in a session variable

2011-02-14 Thread Bobby Roberts
just wanted to clarify... i've got the manytomany setup in a user profile. When they login i'm loading certain pieces of their profile into session variables. One of these fields is the MTM and the data is stored outside of the userprofile model in the MTM table... how would I go about taking

trouble storing a manytomany field in a session variable

2011-02-14 Thread Bobby Roberts
I'm trying to figure out how to store a manytomany relationship in a session variable. is the only way really to do it to loop through and make a csv string and save that? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,