Vysloužilý org se pozná tak, že už doorgoval
This commit is contained in:
		
							parent
							
								
									7f7f0d06d8
								
							
						
					
					
						commit
						2cef476872
					
				
					 3 changed files with 13 additions and 13 deletions
				
			
		|  | @ -759,7 +759,7 @@ class Organizator(models.Model): | |||
|             null = True, blank = True) | ||||
|     foto = models.ImageField('Fotografie organizátora', | ||||
|             upload_to='image_organizatori/velke/%Y/', null = True, blank = True, | ||||
|             help_text = 'Vlož fotografii organizátora o libovoné velikosti') | ||||
|             help_text = 'Vlož fotografii organizátora o libovolné velikosti') | ||||
|     foto_male = models.ImageField(upload_to='image_organizatori/male/%Y/', | ||||
|             null = True, blank = True, editable = False) | ||||
| 
 | ||||
|  |  | |||
|  | @ -31,13 +31,13 @@ | |||
|     </div> | ||||
|     {% endif %} | ||||
|     <ul> | ||||
|       {#TODO časovat dle rodu #} | ||||
|       {% if org.organizuje_od_roku %} | ||||
|         <li>{% if aktivni %}Organizuje{% else %}Organizoval{% endif %} od roku {{org.organizuje_od_roku}} | ||||
|       {% endif %} | ||||
|       {% if org.organizuje_do_roku %} | ||||
|         <li>{% if aktivni %}Organizuje{% else %}Organizoval{% endif %} do roku {{org.organizuje_do_roku}} | ||||
|       {% endif %} | ||||
|         <li> | ||||
|           {% if aktivni %} | ||||
|             Organizuje od roku {{org.organizuje_od_roku}} | ||||
|           {% else %} | ||||
|             {#TODO časovat dle rodu #} | ||||
|             Organizoval v letech {{org.organizuje_od_roku}}–{{org.organizuje_do_roku}} | ||||
|           {% endif %} | ||||
|       {% if org.studuje %} | ||||
|         <li>Studuje: {{org.studuje}} | ||||
|       {% endif %} | ||||
|  |  | |||
|  | @ -11,7 +11,7 @@ from .models import Problem, Cislo, Reseni, Nastaveni, Rocnik, Soustredeni, Orga | |||
| from .models import VysledkyZaCislo, VysledkyKCisluZaRocnik, VysledkyKCisluOdjakziva | ||||
| from . import utils | ||||
| 
 | ||||
| import datetime | ||||
| from datetime import timedelta, date | ||||
| from itertools import groupby | ||||
| 
 | ||||
| 
 | ||||
|  | @ -42,8 +42,8 @@ def TemataView(request): | |||
| class TitulniStranaView(generic.ListView): | ||||
|     model = Novinky | ||||
|     template_name='seminar/titulnistrana.html' | ||||
|     pred_dvema_mesici = (datetime.date.today() - datetime.timedelta(2*365/12)) | ||||
|     queryset = Novinky.objects.filter(datum__range=(pred_dvema_mesici, datetime.date.today())) | ||||
|     pred_dvema_mesici = (date.today() - timedelta(2*365/12)) | ||||
|     queryset = Novinky.objects.filter(datum__range=(pred_dvema_mesici, date.today())) | ||||
| 
 | ||||
|     def get_context_data(self, **kwargs): | ||||
|         context = super(TitulniStranaView, self).get_context_data(**kwargs) | ||||
|  | @ -56,7 +56,7 @@ class TitulniStranaView(generic.ListView): | |||
| class CojemamOrganizatoriView(generic.ListView): | ||||
|     model = Organizator | ||||
|     template_name='seminar/cojemam/organizatori.html' | ||||
|     queryset = Organizator.objects.filter(user__is_active=True).order_by('user__first_name') | ||||
|     queryset = Organizator.objects.exclude(organizuje_do_roku__isnull=False, organizuje_do_roku__lt=date.today().year).order_by('user__first_name') | ||||
|     def get_context_data(self, **kwargs): | ||||
|         context = super(CojemamOrganizatoriView, self).get_context_data(**kwargs) | ||||
|         context['aktivni'] = True | ||||
|  | @ -65,7 +65,7 @@ class CojemamOrganizatoriView(generic.ListView): | |||
| class CojemamOrganizatoriStariView(generic.ListView): | ||||
|     model = Organizator | ||||
|     template_name='seminar/cojemam/organizatori.html' | ||||
|     queryset = Organizator.objects.filter(user__is_active=False) | ||||
|     queryset = Organizator.objects.filter(organizuje_do_roku__isnull=False, organizuje_do_roku__lt=date.today().year).order_by('user__first_name') | ||||
| 
 | ||||
| ### Archiv | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Matěj Kocián
						Matěj Kocián