39 lines
941 B
Python
39 lines
941 B
Python
|
from __future__ import unicode_literals
|
||
|
|
||
|
from django.db import models
|
||
|
from django.contrib.auth.models import AbstractUser
|
||
|
|
||
|
class Reference(models.Model):
|
||
|
name = models.CharField(max_length=20, unique=True)
|
||
|
description = models.TextField()
|
||
|
|
||
|
class User(AbstractUser):
|
||
|
ref = models.ForeignKey(Reference, null=True, blank=True)
|
||
|
|
||
|
class QSO(models.Model):
|
||
|
owner = models.ForeignKey(User)
|
||
|
time = models.DateTimeField()
|
||
|
call = models.CharField(max_length=20)
|
||
|
|
||
|
reportTX = models.CharField(max_length=7)
|
||
|
reportRX = models.CharField(max_length=7)
|
||
|
|
||
|
remarks = models.TextField()
|
||
|
|
||
|
class Band(models.Model):
|
||
|
name = models.CharField(max_length=10)
|
||
|
|
||
|
def __str__(self):
|
||
|
return self.name
|
||
|
|
||
|
class Frequency(models.Model):
|
||
|
# qrg
|
||
|
# band
|
||
|
channel = models.CharField(max_length=3)
|
||
|
qrg = models.DecimalField(max_digits=7, decimal_places=3)
|
||
|
band = models.ForeignKey(Band)
|
||
|
|
||
|
def __str__(self):
|
||
|
return "Channel %s: %s MHz" % (self.channel, self.qrg)
|
||
|
|