Commit 6d2ae864 authored by Evili del Rio's avatar Evili del Rio

Upgrade to Django 2.2

parent b635996d
......@@ -45,15 +45,15 @@ INSTALLED_APPS = [
'clades',
]
MIDDLEWARE_CLASSES = [
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.locale.LocaleMiddleware',
]
ROOT_URLCONF = 'birding.urls'
......
......@@ -29,23 +29,23 @@ class Kingdom(BaseName):
class Phylum(BaseName):
kingdom = models.ForeignKey(Kingdom)
kingdom = models.ForeignKey(Kingdom, on_delete=models.PROTECT)
class Classe(BaseName):
phylum = models.ForeignKey(Phylum)
phylum = models.ForeignKey(Phylum, on_delete=models.PROTECT)
class Ordo(BaseName):
classe = models.ForeignKey(Classe)
classe = models.ForeignKey(Classe, on_delete=models.PROTECT)
class Family(BaseName):
ordo = models.ForeignKey(Ordo)
ordo = models.ForeignKey(Ordo, on_delete=models.PROTECT)
class Genus(BaseName):
family = models.ForeignKey(Family)
family = models.ForeignKey(Family, on_delete=models.PROTECT)
class LocaleManager(models.Manager):
......@@ -80,7 +80,7 @@ class Species(BaseName):
taxonomic rank. A species is often defined as a group of organisms capable
of interbreeding and producing fertile offspring.
"""
genus = models.ForeignKey(Genus)
genus = models.ForeignKey(Genus, on_delete=models.PROTECT)
def sci_name(self):
......@@ -135,8 +135,8 @@ class CommonName(models.Model):
"""
cname = models.CharField(max_length=127)
species = models.ForeignKey(Species)
locale = models.ForeignKey(Locale)
species = models.ForeignKey(Species, on_delete=models.PROTECT)
locale = models.ForeignKey(Locale, on_delete=models.PROTECT)
def __unicode__(self):
return u'{0} ({1})'.format(self.cname, self.species.sci_name())
......
Django<1.12; python_version >='3.0'
Django<2.3; python_version >='3.0'
django-bootstrap3
psycopg2-binary
django-heroku
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment