Add IARU Coordination field in TransmitterEntry model
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>spacecruft
parent
9d08f9d275
commit
3d4afd6f78
|
@ -229,6 +229,8 @@ class TransmitterEntrySerializer(serializers.ModelSerializer):
|
|||
'updated': '2020-09-03T13:14:41.552071Z',
|
||||
'citation': 'https://www.ariss.org/press-releases/september-2-2020',
|
||||
'service': 'Amateur',
|
||||
'iaru_coordination': '',
|
||||
'iaru_coordination_url': '',
|
||||
'coordination': '',
|
||||
'coordination_url': ''
|
||||
},
|
||||
|
@ -252,7 +254,7 @@ class TransmitterSerializer(serializers.ModelSerializer):
|
|||
'uuid', 'description', 'alive', 'type', 'uplink_low', 'uplink_high', 'uplink_drift',
|
||||
'downlink_low', 'downlink_high', 'downlink_drift', 'mode', 'mode_id', 'uplink_mode',
|
||||
'invert', 'baud', 'sat_id', 'norad_cat_id', 'status', 'updated', 'citation', 'service',
|
||||
'coordination', 'coordination_url'
|
||||
'iaru_coordination', 'iaru_coordination_url', 'coordination', 'coordination_url'
|
||||
)
|
||||
|
||||
# Keeping alive field for compatibility issues
|
||||
|
|
|
@ -26,12 +26,15 @@ class TransmitterCreateForm(BSModalModelForm): # pylint: disable=too-many-ances
|
|||
fields = [
|
||||
'description', 'type', 'status', 'uplink_low', 'uplink_high', 'uplink_drift',
|
||||
'uplink_mode', 'downlink_low', 'downlink_high', 'downlink_drift', 'downlink_mode',
|
||||
'invert', 'baud', 'citation', 'service', 'coordination', 'coordination_url'
|
||||
'invert', 'baud', 'citation', 'service', 'iaru_coordination', 'iaru_coordination_url',
|
||||
'coordination', 'coordination_url'
|
||||
]
|
||||
labels = {
|
||||
'downlink_low': _('Downlink freq.'),
|
||||
'uplink_low': _('Uplink freq.'),
|
||||
'invert': _('Inverted Transponder?'),
|
||||
'iaru_coordination': _('IARU Coordination'),
|
||||
'iaru_coordination_url': _('IARU Coordination URL'),
|
||||
}
|
||||
widgets = {
|
||||
'description': TextInput(),
|
||||
|
@ -45,12 +48,15 @@ class TransmitterUpdateForm(BSModalModelForm): # pylint: disable=too-many-ances
|
|||
fields = [
|
||||
'description', 'type', 'status', 'uplink_low', 'uplink_high', 'uplink_drift',
|
||||
'uplink_mode', 'downlink_low', 'downlink_high', 'downlink_drift', 'downlink_mode',
|
||||
'invert', 'baud', 'citation', 'service', 'coordination', 'coordination_url'
|
||||
'invert', 'baud', 'citation', 'service', 'iaru_coordination', 'iaru_coordination_url',
|
||||
'coordination', 'coordination_url'
|
||||
]
|
||||
labels = {
|
||||
'downlink_low': _('Downlink freq.'),
|
||||
'uplink_low': _('Uplink freq.'),
|
||||
'invert': _('Inverted Transponder?'),
|
||||
'iaru_coordination': _('IARU Coordination'),
|
||||
'iaru_coordination_url': _('IARU Coordination URL'),
|
||||
}
|
||||
widgets = {
|
||||
'description': TextInput(),
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
# Generated by Django 4.0.4 on 2022-05-11 11:34
|
||||
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('base', '0049_rename_choice_of_freq_coordination_field'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='transmitterentry',
|
||||
name='iaru_coordination',
|
||||
field=models.CharField(choices=[('IARU Coordinated', 'IARU Coordinated'), ('IARU Declined', 'IARU Declined'), ('IARU Uncoordinated', 'IARU Uncoordinated'), ('N/A', 'N/A')], default='N/A', help_text='IARU frequency coordination status for this transmitter', max_length=20),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='transmitterentry',
|
||||
name='iaru_coordination_url',
|
||||
field=models.URLField(blank=True, help_text='URL for more details on this frequency coordination', validators=[django.core.validators.URLValidator(regex="(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+$", schemes=['http', 'https'])]),
|
||||
),
|
||||
]
|
|
@ -30,6 +30,7 @@ SERVICE_TYPE = [
|
|||
'Maritime', 'Meteorological', 'Mobile', 'Radiolocation', 'Radionavigational',
|
||||
'Space Operation', 'Space Research', 'Standard Frequency and Time Signal', 'Unknown'
|
||||
]
|
||||
IARU_COORDINATION_STATUS = ['IARU Coordinated', 'IARU Declined', 'IARU Uncoordinated', 'N/A']
|
||||
COORDINATION_STATUS = [
|
||||
'ITU Requested', 'ITU Rejected', 'ITU Coordinated', 'IARU Requested', 'IARU Declined',
|
||||
'IARU Coordinated', 'Uncoordinated'
|
||||
|
@ -489,6 +490,17 @@ class TransmitterEntry(models.Model):
|
|||
default='Unknown',
|
||||
help_text='The published usage category for this transmitter'
|
||||
)
|
||||
iaru_coordination = models.CharField(
|
||||
choices=list(zip(IARU_COORDINATION_STATUS, IARU_COORDINATION_STATUS)),
|
||||
max_length=20,
|
||||
default='N/A',
|
||||
help_text='IARU frequency coordination status for this transmitter'
|
||||
)
|
||||
iaru_coordination_url = models.URLField(
|
||||
blank=True,
|
||||
help_text='URL for more details on this frequency coordination',
|
||||
validators=[URLValidator(schemes=['http', 'https'], regex=URL_REGEX)]
|
||||
)
|
||||
coordination = models.CharField(
|
||||
choices=list(zip(COORDINATION_STATUS, COORDINATION_STATUS)),
|
||||
max_length=20,
|
||||
|
|
|
@ -118,6 +118,14 @@
|
|||
<dt class="col-sm-6">Inverted</dt>
|
||||
<dd class="col-sm-6">Yes</dd>
|
||||
{% endif %}
|
||||
{% if transmitter.iaru_coordination != 'N/A' %}
|
||||
<dt class="col-sm-6">IARU Coordination</dt>
|
||||
{% if transmitter.iaru_coordination_url != '' %}
|
||||
<dd class="col-sm-6"><a href="{{ transmitter.iaru_coordination_url }}" target="_blank">{{ transmitter.iaru_coordination }}</a></dd>
|
||||
{% else %}
|
||||
<dd class="col-sm-6">{{ transmitter.iaru_coordination }}</dd>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if transmitter.coordination != '' %}
|
||||
<dt class="col-sm-6">Frequency Coordination</dt>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue