예제 #1
0
	def get_members(self, filters=None):
		"""Get members with filter

		:filters: dict containing query parameters.
			Eg. {'fields': 'all', 'filter': 'admins'}

		More info on possible filters:
		https://developers.trello.com/advanced-reference/board#get-1-boards-board-id-members

		:rtype: list of Member
		"""
		json_obj = self.client.fetch_json(
				'/boards/' + self.id + '/members',
				query_params=filters)
		members = list()
		for obj in json_obj:
			m = Member(self.client, obj['id'])
			m.status = obj.get('status', '')
			m.id = obj.get('id', '')
			m.bio = obj.get('bio', '')
			m.url = obj.get('url', '')
			m.username = obj['username']
			m.full_name = obj['fullName']
			m.initials = obj.get('initials', '')
			m.member_type = obj.get('memberType', '')
			members.append(m)

		return members
예제 #2
0
파일: board.py 프로젝트: sarumont/py-trello
	def get_members(self, filters=None):
		"""Get members with filter

		:filters: dict containing query parameters.
			Eg. {'fields': 'all', 'filter': 'admins'}

		More info on possible filters:
		https://developers.trello.com/advanced-reference/board#get-1-boards-board-id-members

		:rtype: list of Member
		"""
		json_obj = self.client.fetch_json(
				'/boards/' + self.id + '/members',
				query_params=filters)
		members = list()
		for obj in json_obj:
			m = Member(self.client, obj['id'])
			m.status = obj.get('status', '')
			m.id = obj.get('id', '')
			m.bio = obj.get('bio', '')
			m.url = obj.get('url', '')
			m.username = obj['username']
			m.full_name = obj['fullName']
			m.initials = obj.get('initials', '')
			m.member_type = obj.get('memberType', '')
			members.append(m)

		return members
예제 #3
0
    def get_members(self, filters=None):
        """Get members with filter

        :rtype: Member
        """
        json_obj = self.client.fetch_json('/boards/' + self.id + '/members',
                                          query_params=filters)
        members = list()
        for obj in json_obj:
            m = Member(self.client, obj['id'])
            m.status = obj.get('status', '').encode('utf-8')
            m.id = obj.get('id', '')
            m.bio = obj.get('bio', '')
            m.url = obj.get('url', '')
            m.username = obj['username'].encode('utf-8')
            m.full_name = obj['fullName'].encode('utf-8')
            m.initials = obj.get('initials', '').encode('utf-8')
            members.append(m)

        return members
예제 #4
0
    def get_members(self, filters=None):
        """Get members with filter

        :rtype: list of Member
        """
        json_obj = self.client.fetch_json(
            '/boards/' + self.id + '/members',
            query_params=filters)
        members = list()
        for obj in json_obj:
            m = Member(self.client, obj['id'])
            m.status = obj.get('status', '')
            m.id = obj.get('id', '')
            m.bio = obj.get('bio', '')
            m.url = obj.get('url', '')
            m.username = obj['username']
            m.full_name = obj['fullName']
            m.initials = obj.get('initials', '')
            members.append(m)

        return members