I am using the passive default.arg but need to convert it to native data type. I was hoping that it was stored as a native type somewhere. At this time I check the column type and convert from a string into a native data type.
I hope that what every is done that I do not loose being able to get the default value for a column without inserting the record into the database. I use the default values for filling in some data for the gui before displaying the record to the user. On add the record has not yet been inserted into the database. What would be really handy is a way to get back row that contains the defaults filled in except for auto increment column. It should convert the defaults to same types as if the row was read from the database. Michael Bayer wrote: > FYI ive been thinking of adding another layer to "default", where a > default-producing SQL query or function would be embedded at runtime > into the INSERT or UPDATE statement's argument clause. This would be > in contrast to PassiveDefault as it is currently, which only defines > a "DEFAULT" on a column definition, and ColumnDefault, which even if > it references a SQL statement, will "pre-execute" the statement > outside of the actual insert/update. this would allow onupdate > defaults to fire inline as well as allowing a wider variety of > oninsert defaults. > > So i was thinking of maybe calling it PassiveDefault(something, > inline=True). although its not entirely "passive" (also the > "passive" name in general kind of sucks since it doesnt describe > itself well). any suggestions ? > > On Aug 29, 2006, at 2:51 PM, Jonathan Ellis wrote: > >> On 8/25/06, Mike Bernson <[EMAIL PROTECTED]> wrote: >>> I am look for a way of getting the default value defined on a >>> column in >>> a table. >>> >>> I have table and column objects. I get the default attribute for the >>> column. If it is a null everything is ok. If it is a PassiveDefault >>> object (might by other object ?) >> Defaults defined in the db are PassiveDefault. Defaults defined at >> the python level are ColumnDefault. >> >>> how do I get the default value from >>> the PassiveDefault object. >> just "passivedefault.arg". >> >> Caveat: sqlite sucks and doesn't really expose the default definition, >> so all args in sqlite are '?', which is enough for SA to know it needs >> to ask the db what value was inserted, but not enough to re-create the >> CREATE TABLE source. >> >> -- >> Jonathan Ellis >> http://spyced.blogspot.com >> >> ---------------------------------------------------------------------- >> --- >> Using Tomcat but need to do more? Need to support web services, >> security? >> Get stuff done quickly with pre-integrated technology to make your >> job easier >> Download IBM WebSphere Application Server v.1.0.1 based on Apache >> Geronimo >> http://sel.as-us.falkag.net/sel? >> cmd=lnk&kid=120709&bid=263057&dat=121642 >> _______________________________________________ >> Sqlalchemy-users mailing list >> Sqlalchemy-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Sqlalchemy-users mailing list > Sqlalchemy-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users