Adding Values to Complex Django View
===

Sorry if this is elementary, but I cannot figure out how to structure my view code to get the values from a `ManyToManyField`, if my views are constructed like:

    @login_required
    def create_in(request, slug):
        element = get_object_or_404(Element, slug=slug)
        a = A.objects.create(element=element, user=request.user)
        a.save()
        return redirect('CreationEditView', pk=a.pk)

The `urlconf` sends the user to `create_in,` where the user selects the  `element` then is redirected to `CreationEditView,` which uses the [BaseUpdateView](https://github.com/django/django/blob/master/django/views/generic/edit.py) from Django Generic Views to manipulate the object:

    class EditView(BaseUpdateView):
        model = A
        form_class = AForm
        context_object_name = 'a'
        page = 'edit.html'

        def get_element(self):
            return self.object.element

        def render_to_response(self, context, **response_kwargs):
            element = self.get_element()
            return render_page(self.request, element,
                               self.page, context)

        def get_success_url(self):
            return reverse('view_all')

        def get_context_data(self, **kwargs):
            context = super(EditView, self).get_context_data(**kwargs)
            return context

        def get_queryset(self):
            qs = super(EditView, self).get_queryset()
            return qs.filter(active=True, user=self.request.user)

        def get(self, request, *args, **kwargs):
            self.object = self.get_object()
            return super(EditView, self).get(request, *args, **kwargs)

        def post(self, request, *args, **kwargs):
            self.object = self.get_object()
            return super(EditView, self).post(request, *args, **kwargs)

        @method_decorator(login_required)
        def dispatch(self, request, *args, **kwargs):
            return super(EditView, self).dispatch(request, *args, **kwargs)

    class CreationEditView(EditView):
        def get_queryset(self):
            qs = super(EditView, self).get_queryset()
            return qs.filter(active=False, user=self.request.user)

        def get_success_url(self):
            return reverse('create_finished',
                           kwargs=dict(pk=self.object.pk))

        def get_context_data(self, **kwargs):
            context = super(CreationEditView, self).get_context_data(**kwargs)
            context['create'] = True
            return context

The page is then rendered via `render_page`, which looks like:

    def render_page(request, element, page, context):
        template_name = element_template_name(element, page)
        try:
            template = get_template(template_name)
        except TemplateDoesNotExist:
            template = get_template('template_location/%s' % page)
        context = RequestContext(request, context)
        return HttpResponse(template.render(context))

If my models are like:

    class Photographer(models.Model):
        name = models.CharField(max_length=20)
        models = models.ManyToManyField('Model')

    class Model(models.Model):
        model = models.CharField(max_length=20, blank=False)
        series = models.ForeignKey('Series', null=True, blank=True)

    class A(models.Model):
        user = models.ForeignKey(User)
        photographer = models.ForeignKey('Photographer', blank=True, null=True)
        model = models.ForeignKey('Model', blank=True, null=True)

How would you go about getting the values from `Photographer` to be properly integrated into the view code to use later in the template? These values will be part of a drop down form that a user will select from. A usage example would be very helpful.

Thanks for any ideas.        