Thanks, Skylar. You're right, it worked. Now I am just shaking my head and
saying "next time, I'll just read the source..."
-Justin
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.
what's wrong with just defining form_valid sth like:
form_valid(self, form):
self.object = form.save(commit=False)
#ponies
self.object.save()
return HttpResponseRedirect(self.get_success_url())
does that not work?
--
You received this message because you are subscribed to the
instead of calling super, you could just call FormMixin.form_valid directly,
yes?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
Hi, I still haven't found an answer to this problem so I am shamelessly
bumping the last updated date.
Thanks in advance for your help!
-Justin
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@
Thanks, Łukasz. I looked into overriding that method too, but it seems like
there should be a cleaner way. I almost feel like the ``ModelFormMixin``
should have an API similar to a ``ModelAdmin`` where one could override a
``save_model()`` method on the subclass.
The ``form_valid()`` method doe
``CreateView`` includes ``ModelFormMixin``, which is responsible for
saving the model form:
def form_valid(self, form):
self.object = form.save()
return super(ModelFormMixin, self).form_valid(form)
So, you need to override that method in your subclass:
class ListCreateView(Cr
Hello,
I am experimenting with the new class based views coming in 1.3 and am
having trouble figuring out when/where to put this code. I want to
populate a model's created_by field with the user of the current
request.
In the old views, I would have done something this:
obj = form.save(commit=Fal
7 matches
Mail list logo