From 0df82ec5348c89734d8ec8a7f03043ea539b2eef Mon Sep 17 00:00:00 2001 From: clavay Date: Thu, 5 May 2022 10:35:17 +0200 Subject: [PATCH] Upgrade to Django 3 --- .gitignore | 2 +- pyscada/gpio/__init__.py | 2 +- pyscada/gpio/apps.py | 1 + pyscada/gpio/models.py | 3 --- setup.py | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 12718b3..e8bd449 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *.pyc -/pyscada_gpio.egg-info/* +/pyscada_*.egg-info/* /.idea/* /dist/* /build/* diff --git a/pyscada/gpio/__init__.py b/pyscada/gpio/__init__.py index 2b94188..432c5b2 100644 --- a/pyscada/gpio/__init__.py +++ b/pyscada/gpio/__init__.py @@ -3,7 +3,7 @@ import pyscada -__version__ = '0.7.0rc18' +__version__ = '0.7.1rc1' __author__ = 'Martin Schröder' default_app_config = 'pyscada.gpio.apps.PyScadaGPIOConfig' diff --git a/pyscada/gpio/apps.py b/pyscada/gpio/apps.py index 2521de4..4fb82ad 100644 --- a/pyscada/gpio/apps.py +++ b/pyscada/gpio/apps.py @@ -10,6 +10,7 @@ class PyScadaGPIOConfig(AppConfig): name = 'pyscada.gpio' verbose_name = _("PyScada GPIO") path = os.path.dirname(os.path.realpath(__file__)) + default_auto_field = 'django.db.models.AutoField' def ready(self): import pyscada.gpio.signals diff --git a/pyscada/gpio/models.py b/pyscada/gpio/models.py index 9a197a4..6a8af5d 100644 --- a/pyscada/gpio/models.py +++ b/pyscada/gpio/models.py @@ -6,13 +6,11 @@ from pyscada.models import Variable from django.db import models -from django.utils.encoding import python_2_unicode_compatible import logging logger = logging.getLogger(__name__) -@python_2_unicode_compatible class GPIODevice(models.Model): gpio_device = models.OneToOneField(Device, null=True, blank=True, on_delete=models.CASCADE) board_choices = (('rpi', 'Raspberry Pi'),) @@ -30,7 +28,6 @@ def __str__(self): return self.gpio_device.short_name -@python_2_unicode_compatible class GPIOVariable(models.Model): gpio_variable = models.OneToOneField(Variable, null=True, blank=True, on_delete=models.CASCADE) gpio_mode_choices = ( diff --git a/setup.py b/setup.py index 4935b80..0980aca 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ platforms=['OS Independent'], classifiers=CLASSIFIERS, install_requires=[ - 'pyscada>=0.7.0rc18', + 'pyscada>=0.7.1rc1', 'rpi.gpio', ], packages=find_packages(exclude=["project", "project.*"]),