Skip to content

Commit

Permalink
removing some code that would never be reached and making read behavi…
Browse files Browse the repository at this point in the history
…or consistant apiable code, by throwing error rather than returning error message
  • Loading branch information
gone committed Mar 10, 2012
1 parent c348b5f commit b2e23ff
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions brubeck/queryset.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,14 @@ def read_all(self):

def read_one(self, iid):
iid = str(iid) # TODO Should be cleaner
if iid in self.db_conn:
return (self.MSG_UPDATED, self.db_conn[iid])
else:
return (self.MSG_FAILED, iid)

def read_many(self, ids):
try:
return [self.read_one(iid) for iid in ids]
return (self.MSG_UPDATED, self.db_conn[iid])
except KeyError:
raise FourOhFourException

def read_many(self, ids):
return [self.read_one(iid) for iid in ids]

### Update Functions

def update_one(self, shield):
Expand Down

0 comments on commit b2e23ff

Please sign in to comment.