Formatting works for comments and description
Supports bold, italic, underline, and links
This commit is contained in:
@@ -3,6 +3,7 @@ from models.models import *
|
||||
class AsanaService(object):
|
||||
TASK_FIELDS = [
|
||||
'name',
|
||||
'html_notes',
|
||||
'notes',
|
||||
'assignee.name',
|
||||
'assignee_status',
|
||||
@@ -23,6 +24,13 @@ class AsanaService(object):
|
||||
'subtasks.name',
|
||||
]
|
||||
|
||||
STORY_FIELDS = [
|
||||
'created_by.name',
|
||||
'html_text',
|
||||
'text',
|
||||
'type'
|
||||
]
|
||||
|
||||
def __init__(self, client):
|
||||
self.client = client
|
||||
self.completed_tasks = False
|
||||
@@ -32,17 +40,6 @@ class AsanaService(object):
|
||||
def __wrap__(self, Klass, values):
|
||||
return map(Klass, values)
|
||||
|
||||
def get_tasks(self, project_id):
|
||||
params = {
|
||||
'completed_since': '' if self.completed_tasks else 'now',
|
||||
'opt_fields': self.TASK_FIELDS,
|
||||
}
|
||||
|
||||
return self.__wrap__(
|
||||
Task,
|
||||
self.client.tasks.find_by_project(project_id, params=params)
|
||||
)
|
||||
|
||||
def get_my_tasks(self):
|
||||
return self.__wrap__(
|
||||
Task,
|
||||
@@ -54,6 +51,11 @@ class AsanaService(object):
|
||||
})
|
||||
)
|
||||
|
||||
def get_project(self, project_id):
|
||||
return Project(
|
||||
self.client.projects.find_by_id(project_id)
|
||||
)
|
||||
|
||||
def get_task(self, task_id):
|
||||
return Task(self.client.tasks.find_by_id(
|
||||
task_id,
|
||||
@@ -61,8 +63,21 @@ class AsanaService(object):
|
||||
'opt_fields': self.TASK_FIELDS
|
||||
}
|
||||
))
|
||||
|
||||
def get_tasks(self, project_id):
|
||||
params = {
|
||||
'completed_since': '' if self.completed_tasks else 'now',
|
||||
'opt_fields': self.TASK_FIELDS,
|
||||
}
|
||||
|
||||
return self.__wrap__(
|
||||
Task,
|
||||
self.client.tasks.find_by_project(project_id, params=params)
|
||||
)
|
||||
|
||||
def get_stories(self, task_id):
|
||||
stories = self.client.stories.find_by_task(task_id)
|
||||
stories = self.client.stories.find_by_task(task_id, params = {
|
||||
'opt_fields': self.STORY_FIELDS
|
||||
})
|
||||
filtered_stories = filter(lambda s: s['type'] == 'comment', stories)
|
||||
return self.__wrap__(Story, filtered_stories)
|
||||
|
||||
Reference in New Issue
Block a user