mirror of
https://github.com/kennethreitz-archive/python-convore.git
synced 2026-06-05 23:40:18 +00:00
use _create_topic_from_api method and delete slug as a key.
in topic.create use _create_topic_from_api instead of doing it on our own. messages don't have a slug attribute. So we can't use it as a key.
This commit is contained in:
+2
-3
@@ -157,15 +157,14 @@ class Topics(SyncedList):
|
||||
def create(self, name):
|
||||
params = {'topic_id': self.group.id, 'name': name}
|
||||
r = post(params ,'groups', self.group.id, 'topics', 'create')
|
||||
topic = models.Topic()
|
||||
topic.import_from_api(deserialize(r.content)['topic'])
|
||||
topic = self._create_topic_from_api(deserialize(r.content)['topic'])
|
||||
self.data.insert(0,topic)
|
||||
return True
|
||||
|
||||
|
||||
class Messages(SyncedList):
|
||||
|
||||
__data_keys__ = ['id', 'slug']
|
||||
__data_keys__ = ['id']
|
||||
|
||||
def __init__(self, topic):
|
||||
super(Messages, self).__init__()
|
||||
|
||||
Reference in New Issue
Block a user