Skip to content

Commit

Permalink
Improve epics support
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed May 5, 2019
1 parent c48749e commit b1d05d0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions taiga/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ def search(self, project, text=''):
search_result.wikipages = self.wikipages.parse_list(
result['wikipages']
)
search_result.epics = self.epics.parse_list(
result['epics']
)
return search_result

def auth(self, username, password):
Expand Down
15 changes: 13 additions & 2 deletions taiga/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ class Epic(CustomAttributeResource, CommentableResource):
:param subject: subject of the :class:`TaskStatus`
:param tags: tags of the :class:`TaskStatus`
:param watchers: watchers of the :class:`TaskStatus`
:param version: version of the :class:`Epic`
"""

endpoint = 'epics'
Expand All @@ -304,7 +305,7 @@ class Epic(CustomAttributeResource, CommentableResource):
allowed_params = [
'assigned_to', 'blocked_note', 'description',
'is_blocked', 'is_closed', 'color', 'project',
'subject', 'tags', 'watchers'
'subject', 'tags', 'watchers', 'version'
]

def list_user_stories(self, **queryparams):
Expand Down Expand Up @@ -1107,7 +1108,8 @@ class Project(InstanceResource):
'severities': Severities,
'roles': Roles,
'points': Points,
'us_statuses': UserStoryStatuses
'us_statuses': UserStoryStatuses,
'milestones': Milestones
}

def get_item_by_ref(self, ref):
Expand Down Expand Up @@ -1856,6 +1858,7 @@ def __init__(self, *args, **kwargs):
self.task = HistoryTask(self.requester)
self.user_story = HistoryUserStory(self.requester)
self.wiki = HistoryWiki(self.requester)
self.epic = HistoryEpic(self.requester)


class HistoryEntity(object):
Expand Down Expand Up @@ -1915,6 +1918,14 @@ def __init__(self, *args, **kwargs):
super(type(self), self).__init__(*args, **kwargs)
self.entity = 'issue'

class HistoryEpic(HistoryEntity):
"""
HistoryEpic model
"""
def __init__(self, *args, **kwargs):
super(type(self), self).__init__(*args, **kwargs)
self.entity = 'epic'


class HistoryTask(HistoryEntity):
"""
Expand Down

0 comments on commit b1d05d0

Please sign in to comment.