First try at playing with model formsets with django and was wondering how to filter by the logged in user. The view below renders a form with all the profiles when I only want them to list one (the user's one).
def create_profile(request):
ProfileFormSet = modelformset_factory(Profile)
if request.method == 'POST':
formset = ProfileFormSet(request.POST, request.FILES)
if formset.is_valid():
instances = formset.save()
else:
formset = ProfileFormSet()
return render_to_response('create_profile.html', {'formset': formset}, context_instance=RequestContext(request))