You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cqtu/contest/models.py

39 lines
941 B

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)