aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/resources/issues.py
blob: e864e79d157a7a3fdad284d5c8b9fb6c43627f3c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
# -*- encoding: utf-8 -*-

from .base import Resource
from .users import User

class Issue(Resource):

    _dates = ('created_at', 'updated_at')
    _maps = {'assignee': User, 'user': User}

    def __str__(self):
        return '<Issue (%s)>' % getattr(self, 'number', '')


class Comment(Resource):

    _dates = ('created_at', 'updated_at')
    _maps = {'user': User}

    def __str__(self):
        return '<Comment (%s)>' % (getattr(self, 'user', ''))


class Event(Resource):

    _dates = ('created_at', )
    _maps = {'actor': User, 'issue': Issue}

    def __str__(self):
        return '<Event (%s)>' % (getattr(self, 'commit_id', ''))