Skip to content
This repository was archived by the owner on Apr 12, 2018. It is now read-only.

Commit 98b8ee0

Browse files
committed
Update models.activity.ActivityTask.from_poll(): do not use querysets (to make less calls to the SWF API)
1 parent 07bd15e commit 98b8ee0

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

swf/models/activity.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,18 +241,17 @@ def __init__(self, domain, task_list,
241241

242242
@classmethod
243243
def from_poll(cls, domain, task_list, data):
244-
from swf.querysets import ActivityTypeQuerySet
245-
from swf.querysets import WorkflowExecutionQuerySet
244+
from .workflow import WorkflowExecution
246245

247-
activity_type = ActivityTypeQuerySet(domain).get(
246+
activity_type = ActivityType(
247+
domain,
248248
data['activityType']['name'],
249-
data['activityType']['version'],
250-
)
249+
data['activityType']['version'])
251250

252-
workflow_execution = WorkflowExecutionQuerySet(domain).get(
251+
workflow_execution = WorkflowExecution(
252+
domain,
253253
data['workflowExecution']['workflowId'],
254-
data['workflowExecution']['runId'],
255-
)
254+
data['workflowExecution']['runId'])
256255

257256
return cls(
258257
domain,

0 commit comments

Comments
 (0)