From 364d1572068a3a6c9301c1dc36851ac6ada2080a Mon Sep 17 00:00:00 2001 From: Bradley Gunn Date: Mon, 16 Jan 2017 11:34:46 -0500 Subject: [PATCH] add Contact model from clever API --- README.md | 1 + clever/__init__.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a984fe4..3b97dd6 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Get started by importing the `clever` module and setting your authentication met The `clever` module exposes classes corresponding to resources: +* Contact * District * DistrictAdmin * School diff --git a/clever/__init__.py b/clever/__init__.py index fc34a9f..233e4de 100644 --- a/clever/__init__.py +++ b/clever/__init__.py @@ -719,7 +719,7 @@ def iter(cls, auth=None, **params): requestor = APIRequestor(auth) url = cls.class_url() - params['limit'] = cls.ITER_LIMIT + params['limit'] = cls.ITER_LIMIT while url: response, auth = requestor.request('get', url, params) @@ -728,7 +728,7 @@ def iter(cls, auth=None, **params): break for datum in convert_to_clever_object(cls, response, auth): yield datum - + url = get_link(response, 'prev' if 'ending_before' in params else 'next') # params already included in url from get_link params = {} @@ -772,6 +772,10 @@ def delete(self, **params): # API objects +class Contact(ListableAPIResource): + pass + + class District(ListableAPIResource): pass