korektury | pridani polozky autor_org
Migrace autora z CharField na odkaz na Organizator Vytvoreni nove polozky, ktera odkazuje primo na Organizator
This commit is contained in:
		
							parent
							
								
									d67f58b9ef
								
							
						
					
					
						commit
						4ed195bc95
					
				
					 2 changed files with 33 additions and 3 deletions
				
			
		
							
								
								
									
										25
									
								
								korektury/migrations/0010_Pridani_odkazu_na_organizatora.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								korektury/migrations/0010_Pridani_odkazu_na_organizatora.py
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,25 @@ | ||||||
|  | # -*- coding: utf-8 -*- | ||||||
|  | from __future__ import unicode_literals | ||||||
|  | 
 | ||||||
|  | from django.db import migrations, models | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class Migration(migrations.Migration): | ||||||
|  | 
 | ||||||
|  |     dependencies = [ | ||||||
|  |         ('seminar', '0041_konfery'), | ||||||
|  |         ('korektury', '0009_trizeni_korektur_v_seznamu'), | ||||||
|  |     ] | ||||||
|  | 
 | ||||||
|  |     operations = [ | ||||||
|  |         migrations.AddField( | ||||||
|  |             model_name='komentar', | ||||||
|  |             name='autor_org', | ||||||
|  |             field=models.ForeignKey(blank=True, to='seminar.Organizator', help_text='Autor koment\xe1\u0159e', null=True), | ||||||
|  |         ), | ||||||
|  |         migrations.AddField( | ||||||
|  |             model_name='oprava', | ||||||
|  |             name='autor_org', | ||||||
|  |             field=models.ForeignKey(blank=True, to='seminar.Organizator', help_text=b'Autor opravy', null=True), | ||||||
|  |         ), | ||||||
|  |     ] | ||||||
|  | @ -7,6 +7,8 @@ from django.utils.encoding import python_2_unicode_compatible | ||||||
| from django.utils.encoding import force_unicode | from django.utils.encoding import force_unicode | ||||||
| from django.core.exceptions import ObjectDoesNotExist | from django.core.exceptions import ObjectDoesNotExist | ||||||
| 
 | 
 | ||||||
|  | from seminar.models import Organizator | ||||||
|  | 
 | ||||||
| import subprocess | import subprocess | ||||||
| from reversion import revisions as reversion | from reversion import revisions as reversion | ||||||
| 
 | 
 | ||||||
|  | @ -120,9 +122,10 @@ class Oprava(models.Model): | ||||||
|     status = models.CharField(u'stav opravy',max_length=16, choices=STATUS_CHOICES, blank=False, |     status = models.CharField(u'stav opravy',max_length=16, choices=STATUS_CHOICES, blank=False, | ||||||
|             default = STATUS_K_OPRAVE) |             default = STATUS_K_OPRAVE) | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|     # TODO: Změnit na cizí klíč do orgů |  | ||||||
|     autor = models.CharField(u'autor opravy',blank = True,max_length=20, help_text='Autor opravy') |     autor = models.CharField(u'autor opravy',blank = True,max_length=20, help_text='Autor opravy') | ||||||
|  |     autor_org = models.ForeignKey(Organizator, blank = True, | ||||||
|  |             help_text='Autor opravy', | ||||||
|  |             null = True) # TODO odstranit prizvisko User, TODO null = False | ||||||
|      |      | ||||||
|     text = models.TextField(u'text opravy',blank = True, help_text='Text opravy') |     text = models.TextField(u'text opravy',blank = True, help_text='Text opravy') | ||||||
| 
 | 
 | ||||||
|  | @ -150,8 +153,10 @@ class Komentar(models.Model): | ||||||
|     cas = models.DateTimeField(u'čas komentáře',default=timezone.now,help_text = 'Čas zadání komentáře') |     cas = models.DateTimeField(u'čas komentáře',default=timezone.now,help_text = 'Čas zadání komentáře') | ||||||
| 
 | 
 | ||||||
|     oprava = models.ForeignKey(Oprava) |     oprava = models.ForeignKey(Oprava) | ||||||
|     # TODO: Změnit na cizí klíč do orgů |  | ||||||
|     autor = models.CharField(u'autor komentáře',blank = True,max_length=20, help_text='Autor komentáře') |     autor = models.CharField(u'autor komentáře',blank = True,max_length=20, help_text='Autor komentáře') | ||||||
|  |     autor_org = models.ForeignKey(Organizator, blank = True, | ||||||
|  |             help_text = u'Autor komentáře', | ||||||
|  |             null = True) # TODO odstranit prizvisko User, TODO null = False | ||||||
|      |      | ||||||
|     text = models.TextField(u'text komentáře',blank = True, help_text='Text komentáře') |     text = models.TextField(u'text komentáře',blank = True, help_text='Text komentáře') | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Bc. Petr Pecha
						Bc. Petr Pecha