Pridana polozka pro typ soustredeni/akce
This commit is contained in:
		
							parent
							
								
									73a594512c
								
							
						
					
					
						commit
						be3cd4b283
					
				
					 3 changed files with 32 additions and 2 deletions
				
			
		|  | @ -319,10 +319,10 @@ class SoustredeniAdminForm(forms.ModelForm): | ||||||
| class SoustredeniAdmin(reversion.VersionAdmin): | class SoustredeniAdmin(reversion.VersionAdmin): | ||||||
|     form = SoustredeniAdminForm |     form = SoustredeniAdminForm | ||||||
|     fieldsets = [ |     fieldsets = [ | ||||||
|         (None,              {'fields': ['rocnik', 'misto', 'verejne_db', 'text']}), |         (None,              {'fields': ['rocnik', 'misto', 'typ', 'verejne_db', 'text']}), | ||||||
|         (u'Data',           {'fields': ['datum_zacatku', 'datum_konce']}), |         (u'Data',           {'fields': ['datum_zacatku', 'datum_konce']}), | ||||||
|         ] |         ] | ||||||
|     list_display = ['rocnik', 'misto', 'datum_zacatku', 'verejne'] |     list_display = ['rocnik', 'misto', 'datum_zacatku', 'typ', 'verejne'] | ||||||
|     inlines = [Soustredeni_UcastniciInline] |     inlines = [Soustredeni_UcastniciInline] | ||||||
|     list_filter = ['rocnik'] |     list_filter = ['rocnik'] | ||||||
|     view_on_site = Soustredeni.verejne_url |     view_on_site = Soustredeni.verejne_url | ||||||
|  |  | ||||||
							
								
								
									
										20
									
								
								seminar/migrations/0026_soustredeni_typ.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								seminar/migrations/0026_soustredeni_typ.py
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,20 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | from __future__ import unicode_literals | ||||||
|  | 
 | ||||||
|  | from django.db import models, migrations | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class Migration(migrations.Migration): | ||||||
|  | 
 | ||||||
|  |     dependencies = [ | ||||||
|  |         ('seminar', '0025_zmena_cesty_nahravani_obrazku'), | ||||||
|  |     ] | ||||||
|  | 
 | ||||||
|  |     operations = [ | ||||||
|  |         migrations.AddField( | ||||||
|  |             model_name='soustredeni', | ||||||
|  |             name='typ', | ||||||
|  |             field=models.CharField(default=b'podzimni', max_length=16, verbose_name='typ akce', choices=[(b'jarni', 'Jarn\xed soust\u0159ed\u011bn\xed'), (b'podzimni', 'Podzimn\xed soust\u0159ed\u011bn\xed'), (b'sraz', 'Nepravideln\xfd sraz')]), | ||||||
|  |             preserve_default=True, | ||||||
|  |         ), | ||||||
|  |     ] | ||||||
|  | @ -565,6 +565,16 @@ class Soustredeni(SeminarModelBase): | ||||||
| 
 | 
 | ||||||
|     text = models.TextField(u'text k soustředění (HTML)', blank=True, default='') |     text = models.TextField(u'text k soustředění (HTML)', blank=True, default='') | ||||||
| 
 | 
 | ||||||
|  |     TYP_JARNI = 'jarni' | ||||||
|  |     TYP_PODZIMNI = 'podzimni' | ||||||
|  |     TYP_SRAZ = 'sraz' | ||||||
|  |     TYP_CHOICES = [ | ||||||
|  |         (TYP_JARNI, u'Jarní soustředění'), | ||||||
|  |         (TYP_PODZIMNI, u'Podzimní soustředění'), | ||||||
|  |         (TYP_SRAZ, u'Nepravidelný sraz'), | ||||||
|  |         ] | ||||||
|  |     typ = models.CharField(u'typ akce', max_length=16, choices=TYP_CHOICES, blank=False, default=TYP_PODZIMNI) | ||||||
|  | 
 | ||||||
|     def __str__(self): |     def __str__(self): | ||||||
|         return force_unicode(u'%s (%s)' % (self.misto, self.datum_zacatku)) |         return force_unicode(u'%s (%s)' % (self.misto, self.datum_zacatku)) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Tomas Gavenciak
						Tomas Gavenciak