reduce team shift view query count
This commit is contained in:
parent
4f4b5c3009
commit
7aa5da28fe
|
@ -93,7 +93,9 @@ def add_helper_shift(self):
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def shift_detail(request, pk):
|
def shift_detail(request, pk):
|
||||||
shift = get_object_or_404(Shift, pk=pk)
|
shift = get_object_or_404(
|
||||||
|
Shift.with_reg_count().prefetch_related("shiftregistration_set__helper"), pk=pk
|
||||||
|
)
|
||||||
form = HelperShift()
|
form = HelperShift()
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
form = HelperShift(request.POST)
|
form = HelperShift(request.POST)
|
||||||
|
|
Loading…
Reference in New Issue