I should also clarify just in case anyone else runs into the same problem
in the future:
My form_valid() was not working correctly because I had my form definition
excluding a (required) field so it would NEVER be able to save my model
under any circumstance.
def form_valid(self, form):
That reassures me then.
In the past I stayed away from the generic class based views and in my
current project I'm using nothing but them.
Everything is working but it's not clear by looking at it *why* it works.
There might be a little too much magic happening for my liking but I'm
going to s
I use the same pattern in my application, and it works just fine.
def dispatch(self, *args, **kwargs):
self.tc = get_object_or_404(TrainingClass, pk=kwargs.get('class_id',
None))
return super(TrainingScheduleCreateView, self).dispatch(*args,
**kwargs)
def form_vali
Actually that totally didn't work - I don't know what I was thinking. The
form_valid method doesn't work for saving the model.
I have it working now but I guess the question I had is if using dispatch
for setting variables in general is a good idea.
On Monday, June 10, 2013 3:38:09 PM UTC-7, Ja
I'm having trouble wrapping my head around how to use generic class based
views properly when it comes to creating objects associated with already
created objects.
The concept here is adding File objects to a Case object.
The url pattern would be something like:
url(r'^case/(?P\d+)/add/$', Add
5 matches
Mail list logo