Exemple #1
0
    def test_callable_as_kwarg(self):
        ucode = util.partial(Unicode, assert_unicode=None)

        thang_table = Table('thang', meta,
                            Column('name', type_=ucode(20), primary_key=True))
        assert isinstance(thang_table.c.name.type, Unicode)
        thang_table.create()
Exemple #2
0
    def test_callable_as_kwarg(self):
        ucode = util.partial(Unicode, assert_unicode=None)

        thang_table = Table('thang', meta,
            Column('name', type_=ucode(20), primary_key=True)
        )
        assert isinstance(thang_table.c.name.type, Unicode)
        thang_table.create()
Exemple #3
0
    def test_callable_as_arg(self):
        ucode = util.partial(Unicode, assert_unicode=None)

        thing_table = Table('thing', meta,
            Column('name', ucode(20))
        )
        assert isinstance(thing_table.c.name.type, Unicode)
        thing_table.create()
 def __init__(self, cls, key, descriptor=None, doc=None, 
         comparator_factory = None):
     self.parent = cls.__mapper__
     self.key = key
     self.doc = doc
     self.descriptor = descriptor
     if comparator_factory:
         self._comparator_factory = partial(comparator_factory, self)
     else:
         self._comparator_factory = lambda mapper: None
Exemple #5
0
 def __init__(self,
              cls,
              key,
              descriptor=None,
              doc=None,
              comparator_factory=None):
     self.parent = cls.__mapper__
     self.key = key
     self.doc = doc
     self.descriptor = descriptor
     if comparator_factory:
         self._comparator_factory = partial(comparator_factory, self)
     else:
         self._comparator_factory = lambda mapper: None
Exemple #6
0
    def test_callable_as_arg(self):
        ucode = util.partial(Unicode, assert_unicode=None)

        thing_table = Table('thing', meta, Column('name', ucode(20)))
        assert isinstance(thing_table.c.name.type, Unicode)
        thing_table.create()