Re: How add extra data to m2m-field before saving form?

2008-11-27 Thread izzy
if request.method == 'POST': form = EventForm(request.POST) if form.is_valid(): form.save() form.members.add(request.user) # THIS LINE DOESNT WORK form.save_m2m() return HttpResponseRedirect('/events/') else: form = Ev

Re: How add extra data to m2m-field before saving form?

2008-11-27 Thread urukay
functions) Hope it helps. Radovan dexter-22 wrote: > > > This is the error i receive: > > 'EventForm' object has no attribute 'managers' > > > > -- View this message in context: http://www.nabble.com/How-add-extra-data-to-m2m-field-before-savi

Re: How add extra data to m2m-field before saving form?

2008-11-26 Thread dexter
This is the error i receive: 'EventForm' object has no attribute 'managers' --~--~-~--~~~---~--~~ 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

How add extra data to m2m-field before saving form?

2008-11-26 Thread dexter
I want to add 'request.user' to 'members' of an 'event' that the user creates. I have tried several different methods and googled without finding any correct solutions. Right now, code looks like this but still wont work: # views.py def new_event(request): if request.method == 'POST':