[sqlalchemy] Re: problem with server_default (and/or sa.PassiveDefault in 0.5.beta1

2008-07-13 Thread Kless
It fails with fields of date. It shows: created_at=*datetime.datetime(2008, 7, 13, 13, 59, 57)* On Jun 21, 7:25 pm, Michael Bayer [EMAIL PROTECTED] wrote: that __repr__ is pretty tortured too; a typical ORM-agnostic approach   is:      def __repr__(self):              return %s(%s) % (    

[sqlalchemy] Re: problem with server_default (and/or sa.PassiveDefault in 0.5.beta1

2008-06-23 Thread Werner F. Bruhin
Svilen and Michael, Thanks for all the pointers. Will look into this all and read up some more on declarative (I like its approach, having things together) and do some more test scripts for my application. Werner Michael Bayer wrote: that __repr__ is pretty tortured too; a typical

[sqlalchemy] Re: problem with server_default (and/or sa.PassiveDefault in 0.5.beta1

2008-06-21 Thread az
u want to autoassign a value to each column at __init__ or what? u could have some Base2 that does the repr/init/whatever as mixin. say have a property _my_attrs that could walk once the class.__dict__ - if u want only local stuff - or dir(self) - if u want all inherited stuff too - , and

[sqlalchemy] Re: problem with server_default (and/or sa.PassiveDefault in 0.5.beta1

2008-06-21 Thread az
sorry, here one for the init part: set_as_attributes() in http://dbcook.svn.sourceforge.net/viewvc/dbcook/trunk/tests/util/struct.py?revision=6view=markup or much simpler, setattr_kargs() in http://dbcook.svn.sourceforge.net/viewvc/dbcook/trunk/dbcook/util/attr.py?revision=288view=markup On

[sqlalchemy] Re: problem with server_default (and/or sa.PassiveDefault in 0.5.beta1

2008-06-21 Thread Michael Bayer
that __repr__ is pretty tortured too; a typical ORM-agnostic approach is: def __repr__(self): return %s(%s) % ( (self.__class__.__name__), ', '.join([%s=%r % (key, getattr(self, key)) for key in

[sqlalchemy] Re: problem with server_default (and/or sa.PassiveDefault in 0.5.beta1

2008-06-18 Thread Werner F. Bruhin
I did some more research on this. If I change back to 0.4.3, i.e. change my model to use: ##pkg_resources.require(sqlalchemy) # get latest version pkg_resources.require(sqlalchemy==0.4.3) # use a specific version Then I can debug my code, i.e. my application starts. So, I changed it

[sqlalchemy] Re: problem with server_default (and/or sa.PassiveDefault in 0.5.beta1

2008-06-18 Thread Werner F. Bruhin
Werner F. Bruhin wrote: I did some more research on this. If I change back to 0.4.3, i.e. change my model to use: ##pkg_resources.require(sqlalchemy) # get latest version pkg_resources.require(sqlalchemy==0.4.3) # use a specific version Then I can debug my code, i.e. my application

[sqlalchemy] Re: problem with server_default (and/or sa.PassiveDefault in 0.5.beta1

2008-06-18 Thread Michael Bayer
On Jun 18, 2008, at 4:05 AM, Werner F. Bruhin wrote: All other tables (including the full version of preferences) are using metadata = sa.MetaData(), instead of the metadataMin I use for the prefminimal definition. I got this working some month ago, but maybe this is not the right way to

[sqlalchemy] Re: problem with server_default (and/or sa.PassiveDefault in 0.5.beta1

2008-06-18 Thread Werner F. Bruhin
Michael Bayer wrote: On Jun 18, 2008, at 4:05 AM, Werner F. Bruhin wrote: All other tables (including the full version of preferences) are using metadata = sa.MetaData(), instead of the metadataMin I use for the prefminimal definition. I got this working some month ago, but maybe this

[sqlalchemy] Re: problem with server_default (and/or sa.PassiveDefault in 0.5.beta1

2008-06-18 Thread az
On Wednesday 18 June 2008 17:21:00 Werner F. Bruhin wrote: Michael Bayer wrote: On Jun 18, 2008, at 4:05 AM, Werner F. Bruhin wrote: All other tables (including the full version of preferences) are using metadata = sa.MetaData(), instead of the metadataMin I use for the prefminimal

[sqlalchemy] Re: problem with server_default (and/or sa.PassiveDefault in 0.5.beta1

2008-06-17 Thread Werner F. Bruhin
Michael, Michael Bayer wrote: On Jun 17, 1:06 pm, Werner F. Bruhin [EMAIL PROTECTED] wrote: I just got beta1 and I run into a problem with the following: sa.Column(u'consumedvalue', sa.Numeric(precision=18, length=2, asdecimal=True), sa.PassiveDefault()), consumedvalue is a