count() [ticket:287]
- deregister Table from MetaData when autoload fails; [ticket:289]
- import of py2.5s sqlite3 [ticket:293]
+- unicode fix for startswith()/endswith() [ticket:296]
0.2.7
- quoting facilities set up so that database-specific quoting can be
# statement out of it.
return self._compare('IN', union(parens=True, *other))
def startswith(self, other):
- return self._compare('LIKE', str(other) + "%")
+ return self._compare('LIKE', other + "%")
def endswith(self, other):
- return self._compare('LIKE', "%" + str(other))
+ return self._compare('LIKE', "%" + other)
def label(self, name):
return Label(name, self, self.type)
def distinct(self):
literal("a") + literal("b") * literal("c"), ":literal + (:liter_1 * :liter_2)"
)
+ def testunicodestartswith(self):
+ string = u"hi \xf6 \xf5"
+ self.runtest(
+ table1.select(table1.c.name.startswith(string)),
+ "SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.name LIKE :mytable_name",
+ checkparams = {'mytable_name': u'hi \xf6 \xf5%'},
+ )
+
def testmultiparam(self):
self.runtest(
select(["*"], or_(table1.c.myid == 12, table1.c.myid=='asdf', table1.c.myid == 'foo')),