queryset restricted to form element entries related to the form entry in position calculation

This commit is contained in:
mariuccio 2016-07-07 15:37:33 +02:00
parent 4841c80d2a
commit 67b243d189

View file

@ -474,7 +474,7 @@ def add_form_element_entry(request,
if save_object:
# Handling the position
position = 1
records = FormElementEntry._default_manager \
records = FormElementEntry.objects.filter(form_entry=form_entry) \
.aggregate(models.Max('position'))
if records:
try: