Merge lp:~thisfred/u1db/fix-query-parser.py into lp:u1db

Proposed by Eric Casteleijn
Status: Merged
Merged at revision: 280
Proposed branch: lp:~thisfred/u1db/fix-query-parser.py
Merge into: lp:u1db
Diff against target: 30 lines (+3/-3)
1 file modified
u1db/query_parser.py (+3/-3)
To merge this branch: bzr merge lp:~thisfred/u1db/fix-query-parser.py
Reviewer Review Type Date Requested Status
John A Meinel (community) Approve
Review via email: mp+105780@code.launchpad.net

Description of the change

fixed a bug in the can_transform method of the number() mapping, and cleaned up the other can_transform methods.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'u1db/query_parser.py'
2--- u1db/query_parser.py 2012-05-02 21:21:54 +0000
3+++ u1db/query_parser.py 2012-05-15 09:12:21 +0000
4@@ -133,7 +133,7 @@
5 name = "lower"
6
7 def _can_transform(self, val):
8- return not isinstance(val, (int, bool, float, list, dict))
9+ return isinstance(val, basestring)
10
11 def transform(self, values):
12 if not values:
13@@ -156,7 +156,7 @@
14 self.padding = "%%0%sd" % number
15
16 def _can_transform(self, val):
17- return not isinstance(val, (str, bool, float, list, dict))
18+ return isinstance(val, int) and not isinstance(val, bool)
19
20 def transform(self, values):
21 """Transform any integers in values into zero padded strings."""
22@@ -191,7 +191,7 @@
23 name = "split_words"
24
25 def _can_transform(self, val):
26- return not isinstance(val, (int, bool, float, list, dict))
27+ return isinstance(val, basestring)
28
29 def transform(self, values):
30 if not values:

Subscribers

People subscribed via source and target branches