Permalink
Browse files

Make ``R`` and ``Ordering`` proper subclasses of ``Leaf``

  • Loading branch information...
1 parent 96bfaa8 commit 2887a32dd00497d2806a1dd1fc849f173ada2fb8 @coleifer committed Jan 26, 2013
Showing with 13 additions and 2 deletions.
  1. +13 −2 peewee.py
View
@@ -189,6 +189,19 @@ def __init__(self, data):
super(Param, self).__init__()
+class R(Leaf):
+ def __init__(self, value):
+ self.value = value
+ super(R, self).__init__()
+
+
+class Ordering(Leaf):
+ def __init__(self, param, asc):
+ self.param = param
+ self.asc = asc
+ super(Ordering, self).__init__()
+
+
class Func(Leaf):
def __init__(self, name, *params):
self.name = name
@@ -204,8 +217,6 @@ def dec(*args, **kwargs):
return dec
fn = Func(None)
-Ordering = namedtuple('Ordering', ('param', 'asc'))
-R = namedtuple('R', ('value',))
class FieldDescriptor(object):

0 comments on commit 2887a32

Please sign in to comment.