Remove unnecessary fields, add ignore bandcheck, stuff

This commit is contained in:
Sebastian Lohff 2019-01-22 21:43:38 +01:00 committed by root
parent dd58c56e64
commit c188dda016
3 changed files with 13 additions and 7 deletions

View File

@ -64,7 +64,8 @@ class UpdateCategoryForm(forms.Form):
class QSOForm(forms.ModelForm): class QSOForm(forms.ModelForm):
class Meta: class Meta:
model = QSO model = QSO
fields = ["ownNo", "band", "call", "reportTX", "reportRX", "refStr", "otherNo", "remarks"] #fields = ["ownNo", "band", "call", "reportTX", "reportRX", "refStr", "otherNo", "remarks"]
fields = ["ownNo", "band", "call", "reportTX", "reportRX", "refStr", "remarks"]
def __init__(self, user, *args, **kwargs): def __init__(self, user, *args, **kwargs):
super(QSOForm, self).__init__(*args, **kwargs) super(QSOForm, self).__init__(*args, **kwargs)
@ -138,7 +139,8 @@ class QSOForm(forms.ModelForm):
class QSOFormWithTime(QSOForm): class QSOFormWithTime(QSOForm):
class Meta: class Meta:
model = QSO model = QSO
fields = ["time", "ownNo", "band", "call", "reportTX", "reportRX", "otherNo", "refStr", "remarks"] #fields = ["time", "ownNo", "band", "call", "reportTX", "reportRX", "otherNo", "refStr", "remarks"]
fields = ["time", "ownNo", "band", "call", "reportTX", "reportRX", "refStr", "remarks"]
class ShadowCallAddForm(forms.ModelForm): class ShadowCallAddForm(forms.ModelForm):

View File

@ -55,6 +55,10 @@ class User(AbstractUser):
opName = models.CharField(max_length=128, default="", blank=True) opName = models.CharField(max_length=128, default="", blank=True)
regTime = models.DateTimeField(null=True, default=None) regTime = models.DateTimeField(null=True, default=None)
# because of cbr parsing bug, we sometimes have users who only have 70cm qsos
# we ignore the band for them when checking QSOs
ignoreBand = models.BooleanField(default=False)
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(User, self).__init__(*args, **kwargs) super(User, self).__init__(*args, **kwargs)
self._meta.get_field("username").validators = [CallUsernameValidator()] self._meta.get_field("username").validators = [CallUsernameValidator()]
@ -138,7 +142,7 @@ class QSO(models.Model):
reportTX = models.CharField(max_length=7, default=59, verbose_name='RS-S', validators=[reportValidator]) 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]) reportRX = models.CharField(max_length=7, default=59, verbose_name='RS-R', validators=[reportValidator])
ownNo = models.IntegerField(verbose_name='No-S') ownNo = models.IntegerField(verbose_name='No')
otherNo = models.IntegerField(verbose_name='No-R', null=True, blank=True) otherNo = models.IntegerField(verbose_name='No-R', null=True, blank=True)
refStr = models.CharField(max_length=20, verbose_name="EXC") refStr = models.CharField(max_length=20, verbose_name="EXC")

View File

@ -55,13 +55,13 @@
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>NroS</th> <th>Nr</th>
<th>Band</th> <th>Band</th>
<th>UTC</th> <th>UTC</th>
<th>Call</th> <th>Call</th>
<th class="hidden-xs">RS-S</th> <th class="hidden-xs">RS-S</th>
<th class="hidden-xs">RS-R</th> <th class="hidden-xs">RS-R</th>
<th class="hidden-xs">No-R</th> <!-- <th class="hidden-xs">No-R</th> -->
<th>EXC</th> <th>EXC</th>
<th class="hidden-xs">Remarks</th> <th class="hidden-xs">Remarks</th>
<th></th> <th></th>
@ -76,7 +76,7 @@
<td>{{ qso.call }}</td> <td>{{ qso.call }}</td>
<td class="hidden-xs">{{ qso.reportTX }}</td> <td class="hidden-xs">{{ qso.reportTX }}</td>
<td class="hidden-xs">{{ qso.reportRX }}</td> <td class="hidden-xs">{{ qso.reportRX }}</td>
<td class="hidden-xs">{{ qso.otherNo|default:"&nbsp&nbsp;---" }}</td> <!-- <td class="hidden-xs">{{ qso.otherNo|default:"&nbsp&nbsp;---" }}</td> -->
<td>{{ qso.refStr }}</td> <td>{{ qso.refStr }}</td>
<td class="hidden-xs">{{ qso.remarks }}</td> <td class="hidden-xs">{{ qso.remarks }}</td>
<td><a href="{% url "contest:logEdit" qso.id %}"><span class="glyphicon glyphicon-pencil"></span></a> <a href="{% url "contest:logDelete" qso.id %}"><span class="glyphicon glyphicon-trash"></span></a></td> <td><a href="{% url "contest:logEdit" qso.id %}"><span class="glyphicon glyphicon-pencil"></span></a> <a href="{% url "contest:logDelete" qso.id %}"><span class="glyphicon glyphicon-trash"></span></a></td>
@ -138,7 +138,7 @@ $(document).ready(function() {
} }
} }
$("#id_call").on("keydown", function(e) { return mvFocusOnSpace(e, "#id_otherNo"); }); $("#id_call").on("keydown", function(e) { return mvFocusOnSpace(e, "#id_refStr"); });
$("#id_otherNo").on("keydown", function(e) { return mvFocusOnSpace(e, "#id_refStr"); }); $("#id_otherNo").on("keydown", function(e) { return mvFocusOnSpace(e, "#id_refStr"); });
$("#id_refStr").on("keydown", function(e) { return mvFocusOnSpace(e, "#id_call"); }); $("#id_refStr").on("keydown", function(e) { return mvFocusOnSpace(e, "#id_call"); });