new_query = Queryes.objects.create(
name=form_q.cleaned_data['name'],
...
)
new_query.save()
ppk = new_query.pk
mdl = Queryes.objects.get(pk=ppk)
update_form = QueryesForm(request.POST, instance=mdl)
update_form.save()
context['html_data'] = render_to_string('filter_msgs.html', request=request,
context={'form_q': update_form})