Re: [Sqlalchemy-users] sqlite and DateTime types

2006-04-26 Thread Jon Rosebaugh
On 4/26/06, Michael Bayer <[EMAIL PROTECTED]> wrote: > why not use the DateTime type on your Column ? I did: Column('timestamp', DateTime, nullable=3DFalse) It happily accepted seconds-since-the-epoch for storing into the database, but couldn't read it out. The convert_bind_param for SLDateTime d

[Sqlalchemy-users] select and boolean fields

2006-04-26 Thread Jonathan Vanasco
i'm trying to use the select syntax at building queries http://sqlalchemy.org/docs/ sqlconstruction.myt#constructing_select_whereclause I can't seem to place a boolean field into the select statement Based on the docs, I've tried : VerificationHash.c.is_active == False, Veri

Re[4]: [Sqlalchemy-users] Incredibly simple question

2006-04-26 Thread Gambit
Hey Jonathan, I think I'd need to see a little more of your code to really see what you're doing, but here's a recommendation anyways (though probably not as specific as you hope for :). On the wiki in the Usage Recipes section I've tossed up several working examples to demonstrate a couple diffe

Re: Re[2]: [Sqlalchemy-users] Incredibly simple question

2006-04-26 Thread Jonathan Vanasco
On Apr 26, 2006, at 6:16 PM, Todd Grimason wrote: Mike's got a handy-dandy tutorial in the works, but I think you'll have to wait until 0.2 for its unveiling (or you could peek in SVN). svn is cool with me. thanks a ton. --- Using Tomcat

Re: Re[2]: [Sqlalchemy-users] Incredibly simple question

2006-04-26 Thread Todd Grimason
* Jonathan Vanasco [2006-04-26 16:38]: > That helps quite a bit. thank you for all your patience. I promise > to write a 'SQLalchemy for Dummies' wiki page once I get this all > done. I think i've hit every pitfall that someone could meet in a > conversion from hand-sql to orm. i think

Re: [Sqlalchemy-users] table schema attribute with ProxyEngine

2006-04-26 Thread Michael Bayer
On Apr 26, 2006, at 5:04 PM, Randall Smith wrote: Why do I need a connection to define schema? That don't make no sense :) its a bug, the "schema" name is forcing it to ask for a "default schema" name from the database which hasnt been connected yet. this bug does not exist in 0.2 .

Re: [Sqlalchemy-users] sqlite and DateTime types

2006-04-26 Thread Michael Bayer
On Apr 26, 2006, at 4:45 PM, Robert E. Anderson wrote: Another problem I have is that I have yet to figure out a way to pass in a default time of now in sqlite syntax. The following does NOT work: Column('dtm', DateTime), PassiveDefault("datetime('now')")) the sqlite3 docs say you can,

Re: [Sqlalchemy-users] table schema attribute with ProxyEngine

2006-04-26 Thread Randall Smith
Ignore typos in the Python source. I just saw this. > global_connect('postgres://database==mydb') I wrote this up in mutt, actually VIM, and didn't run it, but it should get the point across. Randall On Wed, Apr 26, 2006 at 04:04:22PM -0500, Randall Smith wrote: > I'm very new to sqlalchemy.

[Sqlalchemy-users] table schema attribute with ProxyEngine

2006-04-26 Thread Randall Smith
I'm very new to sqlalchemy. It solves some problems I couldn't solve well with SQLObject. The Table == Class line of thought was preventing me from doing lots of things. Anyhow, to my first issue. I will treat my sqlalchemy creations as a library and use them with various database connection ty

Re: [Sqlalchemy-users] sqlite and DateTime types

2006-04-26 Thread Jonathan Ellis
On 4/26/06, Robert E. Anderson <[EMAIL PROTECTED]> wrote: Another problem I have is that I have yet to figure out a way to pass in a default time of now in sqlite syntax. The following does NOT work: Column('dtm', DateTime), PassiveDefault("datetime('now')"))sqlite understands the ANSI standar

Re: [Sqlalchemy-users] sqlite and DateTime types

2006-04-26 Thread Robert E. Anderson
I had this same problem and it took me a little while to figure it out, so adding a comment about it would be worth while IMHO. In my case I assumed that Date was like Oracles Date and contained a time as well. I then created tables with Date colums and everything was great as long as I put past

Re: Re[6]: [Sqlalchemy-users] question about convert_unicode

2006-04-26 Thread Michael Bayer
On Apr 26, 2006, at 3:07 PM, Luís Bruno wrote: Michael Bayer wrote: +1 ! i might add "no forests of hint options" to the core philosophy. maybe "bring me a shrubbery of options, but not a forest !" Kind of a dictionary of types for mapping database columns to mapper types and back?

Re: [Sqlalchemy-users] sqlite and DateTime types

2006-04-26 Thread Michael Bayer
why not use the DateTime type on your Column ? On Apr 26, 2006, at 2:42 PM, Jon Rosebaugh wrote: I mentioned this on the IRC channel, but thought I'd mention it here as well. The sqlite layer will happily accept various formats for timestamps that it is unable to read back out from the database

Re: Re[2]: [Sqlalchemy-users] Incredibly simple question

2006-04-26 Thread Jonathan Vanasco
On Apr 26, 2006, at 6:09 AM, Gambit wrote: One way to write the query would be to use a proper Clause construct. You can see an example of this in the Basic Data Mapping section at: http://www.sqlalchemy.org/docs/index.myt? paged=no#datamapping_relations_lazyload_relselectby and also

[Sqlalchemy-users] sqlite and DateTime types

2006-04-26 Thread Jon Rosebaugh
I mentioned this on the IRC channel, but thought I'd mention it here as well. The sqlite layer will happily accept various formats for timestamps that it is unable to read back out from the database. It expects a string in a certain format, but I didn't know that, so I tried storing seconds-since-t

Re: Re[6]: [Sqlalchemy-users] question about convert_unicode

2006-04-26 Thread Michael Bayer
On Apr 26, 2006, at 1:48 PM, Jonathan Ellis wrote:On 4/25/06, Vasily Sulatskov <[EMAIL PROTECTED]> wrote: If I understand you correctly, you suggest explict specification oftable columns. Right?But isn't autoload option exactly for avvoiding explict columnspecification?Sure, but obviously there are

Re: Re[4]: [Sqlalchemy-users] question about convert_unicode

2006-04-26 Thread Jonathan Ellis
On 4/24/06, Michael Bayer <[EMAIL PROTECTED]> wrote: On Apr 23, 2006, at 6:45 PM, Jonathan Ellis wrote:> Well I also think people should tell me what they think of> thatits essentially more monkeypatching.>>  Well, it comes down to the usual trade-offs, right?  How hard is > it to accomplish w/

Re: Re[6]: [Sqlalchemy-users] question about convert_unicode

2006-04-26 Thread Jonathan Ellis
On 4/25/06, Vasily Sulatskov <[EMAIL PROTECTED]> wrote: If I understand you correctly, you suggest explict specification oftable columns. Right?But isn't autoload option exactly for avvoiding explict columnspecification?Sure, but obviously there are limits to how much you can expect SA to "guess" f

Re: [Sqlalchemy-users] FYI: Keeping Egg's as Directorys and Not Zips

2006-04-26 Thread Kevin Dangoor
On 4/24/06, Michael Bayer <[EMAIL PROTECTED]> wrote: > theres a flag for that you can use, which I personally dont like but > it seems to be popular... > > well I dont know the flag, but if you make a file setup.cfg with this > in it: > > [egg_info] > tag_build = dev > tag_s

Re: [Sqlalchemy-users] FYI: Keeping Egg's as Directorys and Not Zips

2006-04-26 Thread Kevin Dangoor
On 4/24/06, Gambit <[EMAIL PROTECTED]> wrote: > I'm sure most of you know this already, but in case anyones wondering why the > pdb debugging wasn't working -- if you edit the 'setup.py' file pulled from > subversion and add: "zip_safe = False," to the setup function call, it'll keep > things nice

Re[2]: [Sqlalchemy-users] Incredibly simple question

2006-04-26 Thread Gambit
Hey Jonathan, The reason this doesn't work is because you're supplying to a select query an instance object, when it's expecting either column types, actual values, or some other clause element. The actual error, I think, relates to 'type' being your LazyLoader property, and not an actual column!

[Sqlalchemy-users] [Fwd: localtimestamp func for postgresql]

2006-04-26 Thread Huy Do
Hi, Just noticed that postgresql (v8.0) uses localtimestamp rather then local_timestamp. I've patched my own ansisql.py to make it work for me, but was hoping someone could fix it on the trunk. Thanks Huy --- Using Tomcat but need to do