[sqlalchemy] Re: column type for transparent normalization

2006-12-03 Thread [EMAIL PROTECTED]
Michael Bayer skrev: > Johan Hahn wrote: > > Say I was about to make a telephone book database. I > > would need four columns: id, first name, last name, and > > phone number. > > > > Table('telephone_book', metadata, > > Column('id', Integer, primary_key=True), > > Column('first', Unicode(1

[sqlalchemy] Re: AttributeError: 'ForeignKey' object has no attribute 'is_mutable'

2006-12-03 Thread Robin Munn
On 11/29/06, Nebur <[EMAIL PROTECTED]> wrote: > > (SOLVED!) This message is just for the case that someone gets the above > error message and searches this group. > I had it today, and the reason was a missing "Integer" in table Column > creation, like that:Column("aggrby", ForeignKey(

[sqlalchemy] Re: postgres connection problem

2006-12-03 Thread Michael Bayer
psycopg2 needs to be installed. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EM

[sqlalchemy] postgres connection problem

2006-12-03 Thread Mando
Hi, I've installed SQLalchemy and I've tried to connect to mysql db, and all run correctly. But, If I try to connect to a postgres db I receive thi message: >>> from sqlalchemy import * >>> db = create_engine('postgres://mando:[EMAIL PROTECTED]:5432/mydb') Traceback (most recent call last): Fi

[sqlalchemy] AttributeError: 'ForeignKey' object has no attribute 'is_mutable'

2006-12-03 Thread Nebur
(SOLVED!) This message is just for the case that someone gets the above error message and searches this group. I had it today, and the reason was a missing "Integer" in table Column creation, like that:Column("aggrby", ForeignKey("sim_biobj.id"), nullable=False) instead of: Column("agg

[sqlalchemy] Re: column type for transparent normalization

2006-12-03 Thread Michael Bayer
Johan Hahn wrote: > I've been using sqlachemy for a month and I like it so far. > Documentation could have been more precise IMO, it is > confusing that the indroduction discusses so many ways > to do the same things. Im partly confused since my prior > experience with orm tools is limited. the

[sqlalchemy] Re: colon in where clause when selecting mapped objects

2006-12-03 Thread Michael Bayer
no convenient way to do that right now, youd have to use a bind parameter: select("name=:somebind", somebind=':foo') to enable what you want to do directly would require the parsing that locates ':bind' tokens to be more intelligent about quotes, we can add a ticket for that if you like. --~--

[sqlalchemy] colon in where clause when selecting mapped objects

2006-12-03 Thread Sol
Hello, for a somewhat more complex query I need to specify the where clause explicitly when selecting objects of a mapped class. Now how would one include constants with a colon in such a query? like: session().query(myclass).select("name = ':foo'") Any ideas? -- Cheers, Sol. --~--~-~

[sqlalchemy] column type for transparent normalization

2006-12-03 Thread Johan Hahn
Hi I've been using sqlachemy for a month and I like it so far. Documentation could have been more precise IMO, it is confusing that the indroduction discusses so many ways to do the same things. Im partly confused since my prior experience with orm tools is limited. Say I was about to make a

[sqlalchemy] Re: interval data type

2006-12-03 Thread Manlio Perillo
Michael Bayer ha scritto: > > Manlio Perillo wrote: >> For now I'm using this: >> >> class TimeDelta(types.TypeEngine): >> def __init__(self, precision=6): >> self.precision = precision >> >> def get_col_spec(self): >> return "INTERVAL(%(precision)s)" % {'precision': s

[sqlalchemy] Re: interval data type

2006-12-03 Thread Michael Bayer
Manlio Perillo wrote: > For now I'm using this: > > class TimeDelta(types.TypeEngine): > def __init__(self, precision=6): > self.precision = precision > > def get_col_spec(self): > return "INTERVAL(%(precision)s)" % {'precision': self.precision} > does psycopg2 take/

[sqlalchemy] Re: pysqlite and time support

2006-12-03 Thread Michael Bayer
oops, useless line, took it out. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [E

[sqlalchemy] Re: interval data type

2006-12-03 Thread Manlio Perillo
Michael Bayer ha scritto: > ive never seen this type used before but it appears to be part of the > SQL standard, so if someone submits a patch it will go in. > psycopg2 support interval out of the box, so adding support for it should be very easy (I'm not able to submit a patch since I'm not a

[sqlalchemy] Re: pysqlite and time support

2006-12-03 Thread Manlio Perillo
ram ha scritto: > As far as I know, sqlite will "support" just about any datetime type > you want, including fractional seconds. > > I put the word "support" in quotes because sqlite doesn't really HAVE a > date, time, or datetime type -- it stores all of those items as > strings, and will then a