我有以下模型设置:
class Cluster(models.Model):
name = models.CharField(...)
...
class ResourceRequest(Process):
cluster = models.ForeignKey('Cluster')
def clean(self, ...):
if self.cluster.name == 'abc':
...
当我尝试发布到:
http://pmas-local:8000/workflow/api/tasks/vm_request/resourcerequest/start/
它抱怨说ResourceRequest has no cluster.
Stacktrace 显示if self.cluster.name == 'abc':
导致了问题。