From: Mike Bayer Date: Mon, 3 Apr 2006 03:24:06 +0000 (+0000) Subject: added a type to label.... X-Git-Tag: rel_0_1_6~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29a6d142a99e8b1327fe11b2ad9263bb4a5bc32d;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git added a type to label.... --- diff --git a/doc/build/txt2myt.py b/doc/build/txt2myt.py index 85778cd97a..533ac7033d 100644 --- a/doc/build/txt2myt.py +++ b/doc/build/txt2myt.py @@ -264,5 +264,5 @@ if __name__ == '__main__': input = file(inname).read() html = markdown.markdown(input) myt = html2myghtydoc(html) - file(inname[:-3] + "html", 'w').write(html) + #file(inname[:-3] + "html", 'w').write(html) file(outname, 'w').write(myt) diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index 7f77acf177..52b75b1eeb 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -489,7 +489,7 @@ class CompareMixin(object): def endswith(self, other): return self._compare('LIKE', "%" + str(other)) def label(self, name): - return Label(name, self) + return Label(name, self, self.type) def distinct(self): return CompoundClause(None,"DISTINCT", self) def op(self, operator): @@ -995,11 +995,12 @@ class Alias(FromClause): class Label(ColumnElement): - def __init__(self, name, obj): + def __init__(self, name, obj, type=None): self.name = name while isinstance(obj, Label): obj = obj.obj self.obj = obj + self.type = type or sqltypes.NullTypeEngine() obj.parens=True key = property(lambda s: s.name)