Added skeleton Category

This commit is contained in:
Kenneth Reitz
2011-02-20 14:49:20 -05:00
parent 00b352372c
commit c86ec88c4c
2 changed files with 26 additions and 1 deletions
+17 -1
View File
@@ -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)
+9
View File
@@ -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."""