-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Check that the directionality of the CASCADE behaviour is correct.
When Route is deleted, Job is deleted.
Is Route deleted, when Job is deleted?
class Route(models.Model):
requested = models.DateTimeField(default=timezone.now)
calculated = models.DateTimeField(null=True)
info = models.JSONField(null=True)
mesh = models.ForeignKey(Mesh, on_delete=models.SET_NULL, null=True)
start_lat = models.FloatField()
start_lon = models.FloatField()
end_lat = models.FloatField()
end_lon = models.FloatField()
start_name = models.CharField(max_length=100, null=True, blank=True, default=None)
end_name = models.CharField(max_length=100, null=True, blank=True, default=None)
json = models.JSONField(null=True)
json_unsmoothed = models.JSONField(null=True)
polar_route_version = models.CharField(max_length=60, null=True)
tags = TaggableManager(blank=True, help_text="Tags for route")
class Job(models.Model):
"Route or mesh calculation jobs"
id = models.UUIDField(
primary_key=True
) # use uuids for primary keys to align with celery
datetime = models.DateTimeField(default=timezone.now)
route = models.ForeignKey(Route, on_delete=models.CASCADE)
@property
def status(self):
result = AsyncResult(self.id, app=app)
return result.stateDepends also on the relationship between routes and jobs. For example, when a route recalculated, with a different job, does the route retain its id or is a new route created?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels