Re: ManytoMany uploading.

2006-09-21 Thread Gabriel Puliatti
On 9/21/06, Gabriel Puliatti <[EMAIL PROTECTED]> wrote: > Hm, I used that. I can print new_data.getlist('courses') and get the > list, but when I try to assign it to a variable for writing, I get > "'str' object has no attribute '_get_pk_val'" > > However, this only happens when I do new_profile.s

Re: ManytoMany uploading.

2006-09-21 Thread Gabriel Puliatti
On 9/21/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote: > courses = new_data.getlist('courses') Hm, I used that. I can print new_data.getlist('courses') and get the list, but when I try to assign it to a variable for writing, I get "'str' object has no attribute '_get_pk_val'" However, this onl

Re: ManytoMany uploading.

2006-09-21 Thread Aidas Bendoraitis
Hello Gabriel, Instead of courses = new_data['courses'] use courses = new_data.getlist('courses') The "courses" is not a string, but a class similar to a list type (I don't remember the name of that class). The last item of that list is the representation of that class. Therefore, you see 2 if so

Re: ManytoMany uploading.

2006-09-21 Thread Malcolm Tredinnick
On Thu, 2006-09-21 at 06:42 -0500, Gabriel Puliatti wrote: > On Thu, 2006-09-21 at 06:30 +, pflouret wrote: > > try this: > > > > new_profile = UserProfile(user=new_user, permissions=permissions) > > new_profile.save() > > new_profile.courses = courses > > new_profile.save() > > Tried that.

Re: ManytoMany uploading.

2006-09-21 Thread Gabriel Puliatti
On Thu, 2006-09-21 at 06:30 +, pflouret wrote: > try this: > > new_profile = UserProfile(user=new_user, permissions=permissions) > new_profile.save() > new_profile.courses = courses > new_profile.save() Tried that. Failed with "'str' object has no attribute '_get_pk_val'". -- No violence, g

Re: ManytoMany uploading.

2006-09-20 Thread pflouret
try this: new_profile = UserProfile(user=new_user, permissions=permissions) new_profile.save() new_profile.courses = courses new_profile.save() cheers --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"