Compare commits
2 Commits
ff94b62212
...
c121e874c6
Author | SHA1 | Date |
---|---|---|
Sebastian Lohff | c121e874c6 | |
Sebastian Lohff | 0178fcb3ef |
|
@ -1,6 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
# prepare environment
|
||||
import sys
|
||||
sys.path.append("..")
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import datetime
|
||||
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
|
@ -14,7 +12,7 @@ from .validators import CallUsernameValidator
|
|||
class Contest(models.Model):
|
||||
name = models.CharField(max_length=20)
|
||||
shortName = models.CharField(max_length=20, unique=True)
|
||||
callQrg = models.ForeignKey("Frequency", models.SET_NULL, null=True, blank=True)
|
||||
callQrg = models.ForeignKey("Frequency", on_delete=models.SET_NULL, null=True, blank=True)
|
||||
deadline = models.DateTimeField()
|
||||
|
||||
qsoStartTime = models.DateTimeField()
|
||||
|
@ -136,7 +134,7 @@ signals.post_save.connect(checkForShadowCall, sender=User)
|
|||
|
||||
class Band(models.Model):
|
||||
name = models.CharField(max_length=10)
|
||||
contest = models.ForeignKey(Contest)
|
||||
contest = models.ForeignKey(Contest, on_delete=models.CASCADE)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
@ -147,7 +145,7 @@ class Frequency(models.Model):
|
|||
# band
|
||||
channel = models.CharField(max_length=3)
|
||||
qrg = models.DecimalField(max_digits=7, decimal_places=3)
|
||||
band = models.ForeignKey(Band)
|
||||
band = models.ForeignKey(Band, on_delete=models.CASCADE)
|
||||
|
||||
note = models.CharField(max_length=50, blank=True)
|
||||
|
||||
|
@ -164,11 +162,11 @@ class QSO(models.Model):
|
|||
["owner", "call"],
|
||||
]
|
||||
|
||||
owner = models.ForeignKey(User, db_index=True)
|
||||
owner = models.ForeignKey(User, on_delete=models.CASCADE, db_index=True)
|
||||
time = models.DateTimeField(blank=True)
|
||||
call = models.CharField(max_length=20, db_index=True)
|
||||
callRef = models.ForeignKey(User, models.SET_NULL, related_name='qsoref', null=True, blank=True, default=None)
|
||||
band = models.ForeignKey(Band)
|
||||
callRef = models.ForeignKey(User, on_delete=models.SET_NULL, related_name='qsoref', null=True, blank=True, default=None)
|
||||
band = models.ForeignKey(Band, on_delete=models.CASCADE)
|
||||
|
||||
reportTX = models.CharField(max_length=7, default=59, verbose_name='RS-S', validators=[reportValidator])
|
||||
reportRX = models.CharField(max_length=7, default=59, verbose_name='RS-R', validators=[reportValidator])
|
||||
|
@ -178,11 +176,11 @@ class QSO(models.Model):
|
|||
validators=[MinValueValidator(1), MaxValueValidator(MAX_NO_VALUE)])
|
||||
|
||||
refStr = models.CharField(max_length=20, verbose_name="EXC")
|
||||
ref = models.ForeignKey(Reference, models.SET_NULL, null=True, blank=True)
|
||||
ref = models.ForeignKey(Reference, on_delete=models.SET_NULL, null=True, blank=True)
|
||||
|
||||
remarks = models.CharField(max_length=50, blank=True, default=None)
|
||||
|
||||
cfmdQSO = models.ForeignKey("QSO", models.SET_NULL, null=True, blank=True, default=None)
|
||||
cfmdQSO = models.ForeignKey("QSO", on_delete=models.SET_NULL, null=True, blank=True, default=None)
|
||||
|
||||
CFMD_SEC = 5 * 60
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
from django.core import validators
|
||||
from django.utils import six
|
||||
from django.utils.deconstruct import deconstructible
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
import re
|
||||
|
||||
|
@ -13,7 +12,8 @@ class CallUsernameValidator(validators.RegexValidator):
|
|||
'Enter a valid Callsign as Username, ALL UPPERCASE, if needed with -1 / -2,'
|
||||
'e.g. DL7BST, DN1BER-1, DL/OE1FOO.'
|
||||
)
|
||||
flags = re.ASCII if six.PY3 else 0
|
||||
flags = re.ASCII
|
||||
|
||||
|
||||
@deconstructible
|
||||
class CallLogValidator(validators.RegexValidator):
|
||||
|
@ -22,4 +22,4 @@ class CallLogValidator(validators.RegexValidator):
|
|||
'Enter a valid callsign, ALL UPPERCASE, if needed with -1 / -2,'
|
||||
'e.g. DL7BST, DN1BER-1, DL/OE1FOO, DN1FTW-1/p'
|
||||
)
|
||||
flags = re.ASCII if six.PY3 else 0
|
||||
flags = re.ASCII
|
||||
|
|
Loading…
Reference in New Issue