Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SelectFeature(UpdateView):
- model = ApplicationFeature
- form_class = FeatureSelectForm
- template_name = 'form.html'
- def get_context_data(self, **kwargs):
- # first fetch the context
- context = super(SelectFeature, self).get_context_data(**kwargs*)
- # fetch the object
- obj = self.get_object()
- # do some checking on the object
- if obj.application.owner == self.request.user:
- # the context object is a list of things which
- # will be available in the template
- context['object'] = obj
- # return the context object which contains everything
- return context
- def get_success_url(self):
- return reverse('select_feature', kwargs={"pk":self.object.pk})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement