Browse Source

Upgrade na Django 1.11

remotes/origin/master
parent
commit
2352714689
  1. 2
      galerie/urls.py
  2. 6
      korektury/models.py
  3. 2
      korektury/urls.py
  4. 31
      mamweb/settings_common.py
  5. 9
      mamweb/urls.py
  6. 2
      prednasky/urls.py
  7. 56
      requirements.txt
  8. 32
      seminar/models.py

2
galerie/urls.py

@ -1,6 +1,6 @@
# coding: utf-8 # coding: utf-8
from django.conf.urls import patterns, include, url from django.conf.urls import include, url
from . import views from . import views
urlpatterns = [ urlpatterns = [

6
korektury/models.py

@ -28,7 +28,7 @@ def generate_filename(self, filename):
return os.path.join(settings.KOREKTURY_PDF_DIR, fname) return os.path.join(settings.KOREKTURY_PDF_DIR, fname)
#@reversion.register(ignore_duplicate_revision=True) #@reversion.register(ignore_duplicates=True)
#@python_2_unicode_compatible #@python_2_unicode_compatible
class KorekturovanePDF(models.Model): class KorekturovanePDF(models.Model):
class Meta: class Meta:
@ -112,7 +112,7 @@ class KorekturovanePDF(models.Model):
# uložíme png a změněný počet stran # uložíme png a změněný počet stran
self.convert() self.convert()
@reversion.register(ignore_duplicate_revision=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Oprava(models.Model): class Oprava(models.Model):
class Meta: class Meta:
@ -159,7 +159,7 @@ class Oprava(models.Model):
@reversion.register(ignore_duplicate_revision=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Komentar(models.Model): class Komentar(models.Model):
class Meta: class Meta:

2
korektury/urls.py

@ -1,5 +1,5 @@
from django.conf.urls import * # NOQA from django.conf.urls import * # NOQA
from django.conf.urls import patterns, url from django.conf.urls import url
from django.contrib.auth.decorators import user_passes_test from django.contrib.auth.decorators import user_passes_test
from . import views from . import views

31
mamweb/settings_common.py

@ -51,13 +51,6 @@ AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend', 'django.contrib.auth.backends.ModelBackend',
) )
TEMPLATE_LOADERS = (
('django.template.loaders.cached.Loader', (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'django.template.loaders.eggs.Loader'
)),
)
MIDDLEWARE_CLASSES = ( MIDDLEWARE_CLASSES = (
'reversion.middleware.RevisionMiddleware', 'reversion.middleware.RevisionMiddleware',
@ -72,30 +65,34 @@ MIDDLEWARE_CLASSES = (
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
) )
TEMPLATE_CONTEXT_PROCESSORS = ( TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': (
'django.contrib.auth.context_processors.auth', 'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages', 'django.contrib.messages.context_processors.messages',
'django.core.context_processors.i18n',
'django.core.context_processors.debug',
'django.core.context_processors.request',
'django.core.context_processors.media',
'django.core.context_processors.csrf',
'django.core.context_processors.tz',
'sekizai.context_processors.sekizai', 'sekizai.context_processors.sekizai',
'django.core.context_processors.static',
'mamweb.context_processors.vzhled', 'mamweb.context_processors.vzhled',
) )
},
},
]
INSTALLED_APPS = ( INSTALLED_APPS = (
# Basic # Basic
'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.sites', 'django.contrib.sites',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'django.contrib.auth',
# Utilities # Utilities
'sekizai', 'sekizai',

9
mamweb/urls.py

@ -10,7 +10,7 @@ urlpatterns = [
# Admin a nastroje # Admin a nastroje
url(r'^admin/', include(admin.site.urls)), # NOQA url(r'^admin/', include(admin.site.urls)), # NOQA
url(r'^ckeditor/', include('ckeditor.urls')), url(r'^ckeditor/', include('ckeditor_uploader.urls')),
url(r'^autocomplete/', include('autocomplete_light.urls')), url(r'^autocomplete/', include('autocomplete_light.urls')),
# Seminarova aplikace (ma vlastni podadresare) # Seminarova aplikace (ma vlastni podadresare)
@ -30,7 +30,8 @@ urlpatterns = [
# This is only needed when using runserver. # This is only needed when using runserver.
if settings.DEBUG: if settings.DEBUG:
urlpatterns = [ urlpatterns += [
url(r'^media/(?P<path>.*)$', 'django.views.static.serve', # NOQA url(r'^media/(?P<path>.*)$', views.static.serve, # NOQA
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
] + staticfiles_urlpatterns() + urlpatterns # NOQA ]
urlpatterns += staticfiles_urlpatterns()

2
prednasky/urls.py

@ -1,5 +1,5 @@
from django.conf.urls import * # NOQA from django.conf.urls import * # NOQA
from django.conf.urls import patterns, url from django.conf.urls import url
from django.contrib.auth.decorators import user_passes_test from django.contrib.auth.decorators import user_passes_test
from . import views from . import views

56
requirements.txt

@ -1,43 +1,43 @@
# basic libs # basic libs
psycopg2==2.6.1 psycopg2==2.7.5
html5lib==0.9999999 html5lib==1.0.1
ipython==4.0.1 ipython==5.8.0
Pillow==3.1.0 Pillow==5.2.0
pytz==2015.7 pytz==2018.5
six==1.10.0 six==1.10.0
pexpect==4.0.1 pexpect==4.6.0
traitlets==4.0.0 traitlets==4.3.2
Unidecode==0.4.19 Unidecode==1.0.22
# Django and modules # Django and modules
Django==1.8.8 Django==1.11.15
#django-bootstrap-sass #django-bootstrap-sass
django-mptt==0.8.0 django-mptt==0.9.1
django-reversion==1.10.0 django-reversion==2.0.13
django-sekizai==0.9.0 django-sekizai==0.10.0
django-countries==3.4.1 django-countries==5.3.1
django-solo==1.1.1 django-solo==1.1.3
django-ckeditor<=4.4.5 django-ckeditor==5.6.1
django-flat-theme==1.1.3 django-flat-theme==1.1.4
django-taggit==0.17.6 django-taggit==0.23.0
django-autocomplete-light==2.2.10 django-autocomplete-light==2.3.6
django-crispy-forms==1.6.0 django-crispy-forms==1.7.2
django-imagekit==3.3 django-imagekit==4.0.2
# Comments # Comments
akismet==0.2.0 akismet==1.0.1
django-fluent-comments==1.1 django-fluent-comments==2.0.2
django-threadedcomments==1.0.1 django-threadedcomments==1.2
django-contrib-comments==1.6.2 django-contrib-comments==1.9.0
# debug tools/extensions # debug tools/extensions
django-debug-toolbar==1.4 django-debug-toolbar==1.9.1
django-extensions==1.6.1 django-extensions==2.1.0
sqlparse==0.1.18 sqlparse==0.2.4
Werkzeug==0.11.3 Werkzeug==0.14.1
# G+, FB authorisation # G+, FB authorisation

32
seminar/models.py

@ -50,7 +50,7 @@ class SeminarModelBase(models.Model):
# viz https://ovvp.mff.cuni.cz/wiki/aesop/export-skol. # viz https://ovvp.mff.cuni.cz/wiki/aesop/export-skol.
# #
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Skola(SeminarModelBase): class Skola(SeminarModelBase):
@ -110,7 +110,7 @@ class Skola(SeminarModelBase):
self.mesto)) self.mesto))
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Resitel(SeminarModelBase): class Resitel(SeminarModelBase):
@ -247,7 +247,7 @@ class Resitel(SeminarModelBase):
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Rocnik(SeminarModelBase): class Rocnik(SeminarModelBase):
@ -316,7 +316,7 @@ def cislo_pdf_filename(self, filename):
rocnik = str(self.rocnik.rocnik) rocnik = str(self.rocnik.rocnik)
return os.path.join('cislo', 'pdf', rocnik, '{}-{}.pdf'.format(rocnik, self.cislo)) return os.path.join('cislo', 'pdf', rocnik, '{}-{}.pdf'.format(rocnik, self.cislo))
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Cislo(SeminarModelBase): class Cislo(SeminarModelBase):
@ -426,7 +426,7 @@ class Cislo(SeminarModelBase):
return c return c
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Problem(SeminarModelBase): class Problem(SeminarModelBase):
@ -542,7 +542,7 @@ class Problem(SeminarModelBase):
return u"({}\u2009b)".format(pocet_bodu) if self.body else "" return u"({}\u2009b)".format(pocet_bodu) if self.body else ""
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Reseni(SeminarModelBase): class Reseni(SeminarModelBase):
@ -620,7 +620,7 @@ def generate_filename(self, filename):
) )
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class PrilohaReseni(SeminarModelBase): class PrilohaReseni(SeminarModelBase):
@ -691,7 +691,7 @@ class Pohadka(SeminarModelBase):
return force_unicode(uryvek) return force_unicode(uryvek)
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
class Prispevek(SeminarModelBase): class Prispevek(SeminarModelBase):
problem = models.ForeignKey(Problem, verbose_name='Problém') # TODO autokompleet problem = models.ForeignKey(Problem, verbose_name='Problém') # TODO autokompleet
nazev = models.CharField('Název', max_length=200) nazev = models.CharField('Název', max_length=200)
@ -715,7 +715,7 @@ class Prispevek(SeminarModelBase):
force_unicode(self.problem) + '>' force_unicode(self.problem) + '>'
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Organizator(models.Model): class Organizator(models.Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL, verbose_name='Osoba', user = models.OneToOneField(settings.AUTH_USER_MODEL, verbose_name='Osoba',
@ -760,7 +760,7 @@ class Organizator(models.Model):
verbose_name_plural = 'Organizátoři' verbose_name_plural = 'Organizátoři'
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Soustredeni(SeminarModelBase): class Soustredeni(SeminarModelBase):
@ -821,7 +821,7 @@ class Soustredeni(SeminarModelBase):
return reverse('seminar_seznam_soustredeni') return reverse('seminar_seznam_soustredeni')
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Soustredeni_Ucastnici(models.Model): class Soustredeni_Ucastnici(models.Model):
@ -845,7 +845,7 @@ class Soustredeni_Ucastnici(models.Model):
return force_unicode(u'%s na %s' % (self.resitel, self.soustredeni, )) return force_unicode(u'%s na %s' % (self.resitel, self.soustredeni, ))
# NOTE: Poteciální DB HOG bez select_related # NOTE: Poteciální DB HOG bez select_related
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Soustredeni_Organizatori(models.Model): class Soustredeni_Organizatori(models.Model):
@ -871,7 +871,7 @@ class Soustredeni_Organizatori(models.Model):
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Konfera(models.Model): class Konfera(models.Model):
class Meta: class Meta:
@ -912,7 +912,7 @@ class Konfera(models.Model):
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Konfery_Ucastnici(models.Model): class Konfery_Ucastnici(models.Model):
@ -1008,7 +1008,7 @@ class VysledkyCelkemKCislu(VysledkyBase):
#mozna potreba upravit #mozna potreba upravit
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Nastaveni(SingletonModel): class Nastaveni(SingletonModel):
@ -1030,7 +1030,7 @@ class Nastaveni(SingletonModel):
return False return False
@reversion.register(ignore_duplicate_revisions=True) @reversion.register(ignore_duplicates=True)
@python_2_unicode_compatible @python_2_unicode_compatible
class Novinky(models.Model): class Novinky(models.Model):
datum = models.DateField(auto_now_add=True) datum = models.DateField(auto_now_add=True)

Loading…
Cancel
Save