Zrychlení načítání archivu soustředění
This commit is contained in:
		
							parent
							
								
									8e1a03863f
								
							
						
					
					
						commit
						a72435dd72
					
				
					 2 changed files with 15 additions and 4 deletions
				
			
		|  | @ -58,16 +58,16 @@ | |||
|         {# Účastníci #} | ||||
|         <h2>Soustředění se zúčastnili tito účastníci:</h2> | ||||
|         <p> | ||||
|         {% for i in soustredeni.soustredeni_ucastnici_set.all %} | ||||
|           {{i.resitel}}{% if forloop.last %}.{% else %},{% endif %} | ||||
|         {% for i in soustredeni.ucastnici.all %} | ||||
|           {{i}}{% if forloop.last %}.{% else %},{% endif %} | ||||
|         {% empty %} | ||||
|           Nic! | ||||
|         {% endfor %} | ||||
|         </p> | ||||
|         <h2>Soustředění se účastnili tito organizátoři:</h2> | ||||
|         <p> | ||||
|         {% for i in soustredeni.soustredeni_organizatori_set.all %} | ||||
|           {{i.organizator}}{% if forloop.last %}.{% else %},{% endif %} | ||||
|         {% for i in soustredeni.organizatori.all %} | ||||
|           {{i}}{% if forloop.last %}.{% else %},{% endif %} | ||||
|         {% empty %} | ||||
|           Nic! | ||||
|         {% endfor %} | ||||
|  |  | |||
|  | @ -17,6 +17,17 @@ class SoustredeniListView(generic.ListView): | |||
| 	model = Soustredeni | ||||
| 	template_name = 'soustredeni/seznam_soustredeni.html' | ||||
| 
 | ||||
| 	def get_queryset(self): | ||||
| 		return ( | ||||
| 			Soustredeni.objects | ||||
| 			.prefetch_related( | ||||
| 				"ucastnici", "ucastnici__osoba", | ||||
| 				"organizatori", "organizatori__osoba", | ||||
| 				"galerie_set" | ||||
| 			) | ||||
| 			.select_related("rocnik") | ||||
| 		) | ||||
| 
 | ||||
| 
 | ||||
| def soustredeniObalkyView(request, soustredeni): | ||||
| 	soustredeni = get_object_or_404(Soustredeni, id=soustredeni) | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue