[Fixed]-Combining a Django model + modelform as a single unit

1👍

context['pickform'] = PickForm(initial={'game':context['game_detail']})

https://docs.djangoproject.com/en/1.9/ref/class-based-views/mixins-single-object/#django.views.generic.detail.SingleObjectMixin.get_context_data

It returns a dictionary with these contents:

object: The object that this view is displaying (self.object).

In your form you have set context_object_name = 'game_detail'

Leave a comment