inline save test

This commit is contained in:
Sanj 2012-07-19 23:37:20 +05:30
parent ea381ef53e
commit f1cd2638a9

View File

@ -29,10 +29,10 @@ def edit_profile(request):
if form.is_valid():
instance = form.save()
form.save()
# inlines = [inline(request.POST, request.FILES, instance=person) for inline in form.inlines]
# for inline in inlines:
# if inline.is_valid():
# inline.save()
inlines = [inline(request.POST, request.FILES, instance=person) for inline in form.inlines]
for inline in inlines:
if inline.is_valid():
inline.save()
else:
form = PersonForm(instance=person)