Skip to content

Commit

Permalink
[FIX] write/unlink if ids is int, change to list
Browse files Browse the repository at this point in the history
  • Loading branch information
resteve committed May 4, 2012
1 parent f05d644 commit f7459b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ooop.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def unlink(self, model, ids):
""" remove register """ """ remove register """
if self.debug: if self.debug:
print "DEBUG [unlink]:", model, ids print "DEBUG [unlink]:", model, ids
if not type(ids) == 'list': if isinstance(ids, int):
ids = [ids] ids = [ids]
if self.protocol == 'pyro': if self.protocol == 'pyro':
result = self.proxy.dispatch( 'object', 'execute', self.dbname, self.uid, self.pwd, model, 'unlink', ids) result = self.proxy.dispatch( 'object', 'execute', self.dbname, self.uid, self.pwd, model, 'unlink', ids)
Expand All @@ -205,7 +205,7 @@ def write(self, model, ids, value):
context = {'lang':self.lang} context = {'lang':self.lang}
if self.debug: if self.debug:
print "DEBUG [write]:", model, ids, value print "DEBUG [write]:", model, ids, value
if not type(ids) == 'list': if isinstance(ids, int):
ids = [ids] ids = [ids]
if self.protocol == 'pyro': if self.protocol == 'pyro':
result = self.proxy.dispatch( 'object', 'execute', self.dbname, self.uid, self.pwd, model, 'write', ids, value, context) result = self.proxy.dispatch( 'object', 'execute', self.dbname, self.uid, self.pwd, model, 'write', ids, value, context)
Expand Down

0 comments on commit f7459b5

Please sign in to comment.