20 lines
549 B
Python
20 lines
549 B
Python
from django.db import models
|
|
from .workbench import PureManager
|
|
|
|
# Create your models here.
|
|
|
|
|
|
class Celestial(models.Model):
|
|
name = models.CharField(max_length=100)
|
|
size = models.FloatField()
|
|
weight = models.FloatField()
|
|
|
|
objects = PureManager()
|
|
|
|
class Orbit(models.Model):
|
|
parent = models.ForeignKey(Celestial, related_name='children', on_delete=models.CASCADE)
|
|
celestial = models.ForeignKey(Celestial, related_name='orbits', on_delete=models.CASCADE)
|
|
distance = models.FloatField()
|
|
|
|
objects = PureManager()
|