GroupDiscoverSearch started

This commit is contained in:
Kenneth Reitz
2011-02-21 15:48:17 -05:00
parent f0fb680961
commit 5377ecfd47
2 changed files with 14 additions and 4 deletions
+14 -3
View File
@@ -88,14 +88,25 @@ class GroupDiscoverCategory(SyncedList):
i = [c.slug for c in self.data].index(key)
self.data[i].groups = groups
#
return self.data[i].__dict__
return self.data[i]
def sync(self):
r = api.get('groups', 'discover', 'category')
for _cat in deserialize(r.content)['categories']:
cat = models.Category()
cat.import_from_api(_cat)
self.data.append(cat)
class GroupDiscoverSearch(object):
def __repr__(self):
return '<groups/discover/search endpoint>'
def __getitem__(self, key):
return 'searched.'
-1
View File
@@ -57,7 +57,6 @@ class SyncedList(object):
return _fetched
def __iter__(self):
for d in self.data:
yield d