Re: [Sqlalchemy-users] Need Date Type

2006-01-06 Thread limodou
2006/1/7, Michael Bayer <[EMAIL PROTECTED]>: > > Ill go with Date, Time, DateTime, since DBAPI specifies all threebut > hack your own in the meantime. > Ok. I'v changed the Table field as String, because I just use it to display for now. :) -- I like python! My Blog: http://www.donews.net/lim

Re: [Sqlalchemy-users] Need Date Type

2006-01-06 Thread Michael Bayer
Ill go with Date, Time, DateTime, since DBAPI specifies all threebut hack your own in the meantime. limodou wrote: > 2006/1/7, Michael Bayer <[EMAIL PROTECTED]>: >> >> OK, most databases dont even store dates as a string value, instead >> using >> an internal object format that is translated

Re: [Sqlalchemy-users] Need Date Type

2006-01-06 Thread limodou
2006/1/7, Michael Bayer <[EMAIL PROTECTED]>: > > OK, most databases dont even store dates as a string value, instead using > an internal object format that is translated by the DBAPI layer into > datetime objects. the string date thing is a "feature" of SQLite. So for > SQLite, we just make a gue

Re: [Sqlalchemy-users] easy create user-defined class

2006-01-06 Thread Jonathan Ellis
On 1/6/06, Michael Bayer <[EMAIL PROTECTED]> wrote: > > all of my python conventions came from the styleguide: > > http://www.python.org/peps/pep-0008.html > > so this would explain why Im using "class_": > > If your public attribute name collides with a reserved keyword, append >a single tra

Re: [Sqlalchemy-users] easy create user-defined class

2006-01-06 Thread Michael Bayer
all of my python conventions came from the styleguide: http://www.python.org/peps/pep-0008.html so this would explain why Im using "class_": If your public attribute name collides with a reserved keyword, append a single trailing underscore to your attribute name. This is preferable to

Re: [Sqlalchemy-users] Need Date Type

2006-01-06 Thread Michael Bayer
OK, most databases dont even store dates as a string value, instead using an internal object format that is translated by the DBAPI layer into datetime objects. the string date thing is a "feature" of SQLite. So for SQLite, we just make a guess as to a decent date format. If you are storing dat

Re: [Sqlalchemy-users] easy create user-defined class

2006-01-06 Thread Jonathan Ellis
On 1/5/06, Michael Bayer <[EMAIL PROTECTED]> wrote: also I have class_ all over the place, it has usually seemed lessannoying to me than using 'klass' which I have seen here and there.but I suck at conventionswhat do you think ?It doesn't really bother me either way, but using klass to mean "a

Re: [Sqlalchemy-users] easy create user-defined class

2006-01-06 Thread limodou
> Thanks. I'll take your code, that's great. > But I found the code which Jonathan Ellis supplied shows two many things including mapper, etc. So I change it and the new version is: def assign_class(table, **kwargs): import new import locale encoding = locale.getdefaultlocale()[1]