mirror of
https://github.com/kennethreitz-archive/python-convore.git
synced 2026-06-05 23:40:18 +00:00
Added skeleton Category
This commit is contained in:
+17
-1
@@ -62,4 +62,20 @@ class GroupsDiscoverExplore(object):
|
||||
|
||||
|
||||
class GroupDiscoverCategory(SyncedList):
|
||||
pass
|
||||
|
||||
__data_keys__ = ['name',]
|
||||
|
||||
def __init__(self):
|
||||
super(GroupDiscoverCategory, self).__init__()
|
||||
|
||||
def get(self, key):
|
||||
pass
|
||||
|
||||
def sync(self):
|
||||
r = requests.get(API_URL + 'groups.json')
|
||||
# for _group in json.loads(r.content)['groups']:
|
||||
#
|
||||
# group = models.Group()
|
||||
# group.import_from_api(_group)
|
||||
# group.joined = True
|
||||
# self.data.append(group)
|
||||
|
||||
@@ -40,6 +40,7 @@ class Group(object):
|
||||
self.id = None
|
||||
self.joined = False
|
||||
|
||||
|
||||
def import_from_api(self, d):
|
||||
"""Constructs Group from Deserialized API Response."""
|
||||
|
||||
@@ -72,3 +73,11 @@ class Group(object):
|
||||
|
||||
def __repr__(self):
|
||||
return '<group %s>' % (self.slug)
|
||||
|
||||
|
||||
class Category(self):
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def import_from_api(self, d):
|
||||
"""Constructs Category from deserialized API Response."""
|
||||
|
||||
Reference in New Issue
Block a user