Compare commits
No commits in common. "c121e874c61904358184cbca859207450085ccd3" and "ff94b6221265b30539f57c5276183040ca2bfc34" have entirely different histories.
c121e874c6
...
ff94b62212
|
@ -1,4 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
# prepare environment
|
||||
import sys
|
||||
sys.path.append("..")
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import datetime
|
||||
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
|
@ -12,7 +14,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", on_delete=models.SET_NULL, null=True, blank=True)
|
||||
callQrg = models.ForeignKey("Frequency", models.SET_NULL, null=True, blank=True)
|
||||
deadline = models.DateTimeField()
|
||||
|
||||
qsoStartTime = models.DateTimeField()
|
||||
|
@ -134,7 +136,7 @@ signals.post_save.connect(checkForShadowCall, sender=User)
|
|||
|
||||
class Band(models.Model):
|
||||
name = models.CharField(max_length=10)
|
||||
contest = models.ForeignKey(Contest, on_delete=models.CASCADE)
|
||||
contest = models.ForeignKey(Contest)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
@ -145,7 +147,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, on_delete=models.CASCADE)
|
||||
band = models.ForeignKey(Band)
|
||||
|
||||
note = models.CharField(max_length=50, blank=True)
|
||||
|
||||
|
@ -162,11 +164,11 @@ class QSO(models.Model):
|
|||
["owner", "call"],
|
||||
]
|
||||
|
||||
owner = models.ForeignKey(User, on_delete=models.CASCADE, db_index=True)
|
||||
owner = models.ForeignKey(User, db_index=True)
|
||||
time = models.DateTimeField(blank=True)
|
||||
call = models.CharField(max_length=20, db_index=True)
|
||||
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)
|
||||
callRef = models.ForeignKey(User, models.SET_NULL, related_name='qsoref', null=True, blank=True, default=None)
|
||||
band = models.ForeignKey(Band)
|
||||
|
||||
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])
|
||||
|
@ -176,11 +178,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, on_delete=models.SET_NULL, null=True, blank=True)
|
||||
ref = models.ForeignKey(Reference, models.SET_NULL, null=True, blank=True)
|
||||
|
||||
remarks = models.CharField(max_length=50, blank=True, default=None)
|
||||
|
||||
cfmdQSO = models.ForeignKey("QSO", on_delete=models.SET_NULL, null=True, blank=True, default=None)
|
||||
cfmdQSO = models.ForeignKey("QSO", models.SET_NULL, null=True, blank=True, default=None)
|
||||
|
||||
CFMD_SEC = 5 * 60
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from django.core import validators
|
||||
from django.utils import six
|
||||
from django.utils.deconstruct import deconstructible
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
import re
|
||||
|
||||
|
@ -12,8 +13,7 @@ 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
|
||||
|
||||
flags = re.ASCII if six.PY3 else 0
|
||||
|
||||
@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
|
||||
flags = re.ASCII if six.PY3 else 0
|
||||
|
|
Loading…
Reference in New Issue