[Answer]-Django Form instance not working

1👍

When you create the ModelForm, have to use a CustomerSubscription object instance instead of a UserProfile

def profile(request):
    userprofile = UserProfile.objects.get(user=request.user)
    customer_subs = CustomerSubscription.objects.get(user=userprofile)
    customer_subscription = CustomerSubscriptionForm(instance=customer_subs)
    return render_to_response('profile.html', {'customer_subscription' : customer_subscription, 'customer_subscription':customer_subscription, },context_instance=RequestContext(request))

Leave a comment