From bd3c06d2a715eae7e28515db35d89ea9b6075239 Mon Sep 17 00:00:00 2001 From: Adi Sieker Date: Thu, 7 Apr 2011 23:19:57 +0200 Subject: [PATCH] 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. --- convore/api.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/convore/api.py b/convore/api.py index e3eb169..7e75c81 100644 --- a/convore/api.py +++ b/convore/api.py @@ -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__()