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:
Adi Sieker
2011-04-07 23:19:57 +02:00
parent ef36a7a07c
commit bd3c06d2a7
+2 -3
View File
@@ -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__()