Complete rewrite by OpenCode
This commit is contained in:
@@ -13,7 +13,7 @@ calendar=parsedatetime.Calendar()
|
||||
|
||||
|
||||
def standard_list(request):
|
||||
dokumente = Dokument.objects.all()
|
||||
dokumente = Dokument.objects.select_related('dokumententyp').prefetch_related('vorgaben__thema').all()
|
||||
return render(request, 'standards/standard_list.html',
|
||||
{'dokumente': dokumente}
|
||||
)
|
||||
@@ -29,7 +29,11 @@ def standard_detail(request, nummer,check_date=""):
|
||||
check_date = date.today()
|
||||
standard.history = False
|
||||
standard.check_date=check_date
|
||||
vorgaben = list(standard.vorgaben.order_by("thema","nummer").select_related("thema","dokument")) # convert queryset to list so we can attach attributes
|
||||
vorgaben = list(standard.vorgaben.order_by("thema","nummer")
|
||||
.select_related("thema","dokument")
|
||||
.prefetch_related("relevanz", "referenzen",
|
||||
"vorgabekurztext_set__abschnitttyp",
|
||||
"vorgabelangtext_set__abschnitttyp")) # convert queryset to list so we can attach attributes
|
||||
|
||||
standard.geltungsbereich_html = render_textabschnitte(standard.geltungsbereich_set.order_by("order").select_related("abschnitttyp"))
|
||||
standard.einleitung_html=render_textabschnitte(standard.einleitung_set.order_by("order"))
|
||||
|
||||
Reference in New Issue
Block a user