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
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
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
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':
4 matches
Mail list logo