zmeny pro kompatibilitu s python3
This commit is contained in:
		
							parent
							
								
									8972dbb34d
								
							
						
					
					
						commit
						dd99c34a83
					
				
					 4 changed files with 53 additions and 51 deletions
				
			
		|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| from django.db import models | from django.db import models | ||||||
| #from django.db.models import Q | #from django.db.models import Q | ||||||
| from django.utils.encoding import force_unicode | from django.utils.encoding import force_text | ||||||
| from imagekit.models import ImageSpecField | from imagekit.models import ImageSpecField | ||||||
| from imagekit.processors import ResizeToFit, Transpose | from imagekit.processors import ResizeToFit, Transpose | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -4,7 +4,7 @@ from django.db import models | ||||||
| from django.utils import timezone | from django.utils import timezone | ||||||
| from django.conf import settings | from django.conf import settings | ||||||
| from django.utils.encoding import python_2_unicode_compatible | from django.utils.encoding import python_2_unicode_compatible | ||||||
| from django.utils.encoding import force_unicode | from django.utils.encoding import force_text | ||||||
| from django.core.exceptions import ObjectDoesNotExist | from django.core.exceptions import ObjectDoesNotExist | ||||||
| from django.utils.text import get_valid_filename | from django.utils.text import get_valid_filename | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| from django.db import models | from django.db import models | ||||||
| from django.utils.encoding import python_2_unicode_compatible | from django.utils.encoding import python_2_unicode_compatible | ||||||
| from django.utils.encoding import force_unicode | from django.utils.encoding import force_text | ||||||
| 
 | 
 | ||||||
| from seminar.models import Organizator, Soustredeni | from seminar.models import Organizator, Soustredeni | ||||||
| 
 | 
 | ||||||
|  | @ -20,8 +20,8 @@ STAV_CHOICES = ( | ||||||
| class Seznam(models.Model): | class Seznam(models.Model): | ||||||
| 	class Meta: | 	class Meta: | ||||||
| 		db_table = 'prednasky_seznam' | 		db_table = 'prednasky_seznam' | ||||||
|         verbose_name = u'Seznam přednášek' | 		verbose_name = 'Seznam přednášek' | ||||||
|         verbose_name_plural = u'Seznamy přednášek' | 		verbose_name_plural = 'Seznamy přednášek' | ||||||
| 		ordering = ['soustredeni', 'stav'] | 		ordering = ['soustredeni', 'stav'] | ||||||
| 
 | 
 | ||||||
| 	id = models.AutoField(primary_key = True)  | 	id = models.AutoField(primary_key = True)  | ||||||
|  | @ -29,7 +29,8 @@ class Seznam(models.Model): | ||||||
| 	stav = models.IntegerField('Stav',choices=STAV_CHOICES,default = STAV_NAVRH) | 	stav = models.IntegerField('Stav',choices=STAV_CHOICES,default = STAV_NAVRH) | ||||||
| 
 | 
 | ||||||
| 	def __str__(self): | 	def __str__(self): | ||||||
| 	return force_unicode(u"Seznam {}přednášek na {}".format(u"návrhů " if self.stav == STAV_NAVRH else "",self.soustredeni)) |         	return force_unicode("Seznam {}přednášek na {}".format("návrhů "  | ||||||
|  |                     if self.stav == STAV_NAVRH else "", self.soustredeni)) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| CHOICES_OBTIZNOST = ( | CHOICES_OBTIZNOST = ( | ||||||
|  | @ -48,18 +49,18 @@ CHOICES_BODY = ( | ||||||
| class Prednaska(models.Model): | class Prednaska(models.Model): | ||||||
| 	class Meta: | 	class Meta: | ||||||
| 		db_table = 'prednasky_prednaska' | 		db_table = 'prednasky_prednaska' | ||||||
|         verbose_name = u'Přednáška' | 		verbose_name = 'Přednáška' | ||||||
|         verbose_name_plural = u'Přednášky' | 		verbose_name_plural = 'Přednášky' | ||||||
| 		ordering = ['org', 'nazev'] | 		ordering = ['org', 'nazev'] | ||||||
| 
 | 
 | ||||||
| 	id = models.AutoField(primary_key = True)  | 	id = models.AutoField(primary_key = True)  | ||||||
|     nazev = models.CharField(u'Název', max_length = 300) | 	nazev = models.CharField('Název', max_length = 300) | ||||||
| 	org = models.ForeignKey(Organizator)  | 	org = models.ForeignKey(Organizator)  | ||||||
|     popis = models.TextField(u'Popis pro orgy',null = True, blank = True,help_text = u'Neveřejný popis pro ostatní orgy') | 	popis = models.TextField('Popis pro orgy',null = True, blank = True,help_text = 'Neveřejný popis pro ostatní orgy') | ||||||
|     anotace = models.TextField('Anotace',null = True, blank = True, help_text = u'Veřejná anotace v hlasování') | 	anotace = models.TextField('Anotace',null = True, blank = True, help_text = 'Veřejná anotace v hlasování') | ||||||
|     obtiznost = models.IntegerField(u'Obtížnost', choices=CHOICES_OBTIZNOST) | 	obtiznost = models.IntegerField('Obtížnost', choices=CHOICES_OBTIZNOST) | ||||||
|     obor = models.CharField(u'Obor', max_length = 5, help_text = u'Podmnožina MFIOB') | 	obor = models.CharField('Obor', max_length = 5, help_text = 'Podmnožina MFIOB') | ||||||
|     klicova = models.CharField(u'Klíčová slova', max_length = 200, null = True, blank = True) | 	klicova = models.CharField('Klíčová slova', max_length = 200, null = True, blank = True) | ||||||
| 	seznamy = models.ManyToManyField(Seznam) | 	seznamy = models.ManyToManyField(Seznam) | ||||||
| 
 | 
 | ||||||
| 	def __str__(self): | 	def __str__(self): | ||||||
|  | @ -70,8 +71,8 @@ class Prednaska(models.Model): | ||||||
| class Hlasovani(models.Model): | class Hlasovani(models.Model): | ||||||
| 	class Meta: | 	class Meta: | ||||||
| 		db_table = 'prednasky_hlasovani' | 		db_table = 'prednasky_hlasovani' | ||||||
|         verbose_name = u'Hlasování' | 		verbose_name = 'Hlasování' | ||||||
|         verbose_name_plural = u'Hlasování' | 		verbose_name_plural = 'Hlasování' | ||||||
| 		ordering = ['ucastnik', 'prednaska'] | 		ordering = ['ucastnik', 'prednaska'] | ||||||
| 	id = models.AutoField(primary_key = True)  | 	id = models.AutoField(primary_key = True)  | ||||||
| 	prednaska = models.ForeignKey(Prednaska) | 	prednaska = models.ForeignKey(Prednaska) | ||||||
|  | @ -80,5 +81,6 @@ class Hlasovani(models.Model): | ||||||
| 	seznam = models.ForeignKey(Seznam) | 	seznam = models.ForeignKey(Seznam) | ||||||
| 
 | 
 | ||||||
| 	def __str__(self): | 	def __str__(self): | ||||||
|     	return force_unicode(u"{} dal {} bodů {} v seznamu {}".format(self.ucastnik, self.body, self.prednaska,self.seznam)) | 		return force_unicode("{} dal {} bodů {} v seznamu {}".format(self.ucastnik,  | ||||||
|  |                     self.body, self.prednaska, self.seznam)) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| from autocomplete_light import shortcuts as autocomplete_light | from autocomplete_light import shortcuts as autocomplete_light | ||||||
| 
 | 
 | ||||||
| from models import Skola, Resitel, Problem, Organizator | from .models import Skola, Resitel, Problem, Organizator | ||||||
| from taggit.models import Tag | from taggit.models import Tag | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Anet
						Anet