Initial commit
This commit is contained in:
commit
fe5ef9132a
15 changed files with 888 additions and 0 deletions
0
tests/testapp/__init__.py
Normal file
0
tests/testapp/__init__.py
Normal file
0
tests/testapp/migrations/__init__.py
Normal file
0
tests/testapp/migrations/__init__.py
Normal file
27
tests/testapp/models.py
Normal file
27
tests/testapp/models.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
"""A minimal service, standing in for tdas and odms."""
|
||||
|
||||
from django.db import models
|
||||
|
||||
from yksa_poller.models import AbstractPollingSource, AbstractSourceRun
|
||||
|
||||
|
||||
class Kind(models.TextChoices):
|
||||
HTTP = "http", "HTTP"
|
||||
PUSH = "push", "Push (fed from outside)"
|
||||
|
||||
|
||||
class Satellite(models.Model):
|
||||
norad_cat_id = models.CharField(max_length=16, blank=True)
|
||||
internal_id = models.SlugField(max_length=64)
|
||||
|
||||
|
||||
class Source(AbstractPollingSource):
|
||||
SUBSCRIPTION_ID_FIELDS = {"norad": "norad_cat_id", "internal": "internal_id"}
|
||||
|
||||
kind = models.CharField(max_length=32, choices=Kind.choices)
|
||||
subscription_id_kind = models.CharField(max_length=16, default="norad")
|
||||
tracked_satellites = models.ManyToManyField(Satellite, blank=True)
|
||||
|
||||
|
||||
class Run(AbstractSourceRun):
|
||||
source = models.ForeignKey(Source, on_delete=models.CASCADE, related_name="runs")
|
||||
Loading…
Add table
Add a link
Reference in a new issue