On Sep 20, 2016 5:16 PM, "Netesy Emmanuel" <nete...@gmail.com> wrote:
> My View.py
> class EducationCreate(CreateView):
> model = Education
> form_class = EducationForm
This is the linkage, so it looks like you already have it in place. Is
there a specific issue you are having?
> def form_valid(self, form):
> form.instance.student = self.request.user
> return super(EducationCreate, self).form_valid(form)
> def dispatch(self, *args, **kwargs):
> return super(EducationCreate, self).dispatch(*args, **kwargs)
Are you using 1.10? If so, you can take advantage of the new
LoginRequiredMixin so that you don't need to decorate the dispatch() method.
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to firstname.lastname@example.org.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.