Package pydo :: Module operators :: Class BindingConverter
[show private | hide private]
[frames | no frames]

Class BindingConverter

object --+
         |
        BindingConverter

Known Subclasses:
MssqlConverter, MysqlConverter, PsycopgConverter, SqliteConverter

A value converter that uses bind variables.
>>> op=EQ(FIELD('x'), 45, converter=BindingConverter('format'))
>>> print op
(x = %s)

>>> c=BindingConverter('format')
>>> op=AND(EQ(FIELD('x'), 400), NE(FIELD('y'), ('^', FIELD('z'), 2)), converter=c)
>>> type(op.converter)==BindingConverter
True

>>> type(op[1].converter)==BindingConverter
True

>>> type(op[2].converter)==BindingConverter
True

>>> type(op[2][2].converter)==BindingConverter
True

>>> print op
((x = %s) AND (y != (z ^ %s)))

>>> c.values
[400, 2]

Method Summary
  __init__(self, paramstyle)
  __call__(self, val)
  convert(self, val)
  reset(self)
  _genName(self)
  _genNumber(self)
  _get_paramstyle(self)
  _set_paramstyle(self, paramstyle)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T

Property Summary
  paramstyle
  values

Class Variable Summary
dict converters = {}
tuple supported_styles = ('format', 'pyformat', 'qmark', 'name...

Property Details

paramstyle

Get Method:
_get_paramstyle(self)
Set Method:
_set_paramstyle(self, paramstyle)

values

Get Method:
fget(...)

Class Variable Details

converters

Type:
dict
Value:
{}                                                                     

supported_styles

Type:
tuple
Value:
('format', 'pyformat', 'qmark', 'named', 'numeric')                    

Generated by Epydoc 2.0 on Wed Mar 8 10:18:58 2006 http://epydoc.sf.net