{"issue":{"created_at":"2011-11-25T11:37:24Z","state":"open","updated_at":"2011-11-25T18:09:18Z","user":{"gravatar_id":"372b95474747d294a6ce8a384f311883","id":611357,"url":"https://api.github.com/users/coffeeowl","login":"coffeeowl","avatar_url":"https://secure.gravatar.com/avatar/372b95474747d294a6ce8a384f311883?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":1,"body":"I am trying to attach Mongo DB I already have to Roster. RosterItem says I have to implement two methods - load and save. Looks like it is not enough, because Roster.set_backend tries to access 'entries' on my class. \r\n\r\n    def set_backend(self, db=None):\r\n        \"\"\"\r\n        Set the datastore interface object for the roster.\r\n\r\n        Arguments:\r\n            db -- The new datastore interface.\r\n        \"\"\"\r\n        self.db = db\r\n        for node in self.db.entries(None, {}):\r\n            self.add(node)\r\n        for node in self._rosters:\r\n            self._rosters[node].set_backend(db)\r\n\r\nAlso, what will happen if I invoke this method with default arg for 'db'? I think it will fail, as None can't have 'entries' property.","assignee":null,"id":2348638,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":117,"title":"External DB backend for roster","closed_at":null,"html_url":"https://github.com/fritzy/SleekXMPP/issues/117","url":"https://api.github.com/repos/fritzy/SleekXMPP/issues/117","milestone":null},"action":"created","comment":{"created_at":"2011-11-25T18:09:18Z","updated_at":"2011-11-25T18:09:18Z","user":{"gravatar_id":"7bd3d7290e1753406b15f00a9d7cdcbc","id":38435,"url":"https://api.github.com/users/legastero","login":"legastero","avatar_url":"https://secure.gravatar.com/avatar/7bd3d7290e1753406b15f00a9d7cdcbc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Ah, right. The entries() method needs to go in that doc section too. Here is what that method is supposed to do: given the owner JID for a roster, return all of the item JIDs for it, or if no JID is given return all of the owner JIDs for the multiple rosters.\r\n\r\nAs for the default None value, ``db`` really shouldn't be optional so that will be fixed.\r\n\r\nYou can see how I made a Redis backend here: https://github.com/legastero/SleekRedis/blob/master/redis_roster.py","id":2876860,"url":"https://api.github.com/repos/fritzy/SleekXMPP/issues/comments/2876860"}}