[sqlalchemy] Re: More SA, pyodbc, *nux and MSSQL problems

2009-07-29 Thread Michael Trier
Hi, On Wed, Jul 29, 2009 at 1:30 PM, Ed Singleton wrote: > Stupidly forgot to attach the files. > > > What I'm trying to achieve is: > > > > 1) Ability to insert non-ascii chars into the db on Linux > > 2) The above but for all column types (varchar, text, nvarchar, ntext) > > > > Absolutely any

[sqlalchemy] Re: More SA, pyodbc, *nux and MSSQL problems

2009-07-29 Thread Michael Trier
> > > Finally my stack is: > > > Mac: SA -> iODBC -> FreeTDS -> pyodbc -> MSSQL > > Ubuntu: SA -> unixODBC -> FreeTDS -> pyodbc -> MSSQL > > > > Of course you can remove the xODBC part of the equation if you want, > > but the results are the same. > > Are you sure this is correct? I'd understood

[sqlalchemy] Re: strange problem with relation(..)

2009-07-29 Thread Jon Nelson
On Wed, Jul 29, 2009 at 9:54 PM, Michael Bayer wrote: > > > On Jul 29, 2009, at 10:48 PM, Jon Nelson wrote: > >>> sure just use default=my_callable(ctx).  the ctx contains the bind >>> parameters for the current row.   you could also just use a >>> MapperExtension. >> >> I am not sure how to apply

[sqlalchemy] Re: strange problem with relation(..)

2009-07-29 Thread Michael Bayer
On Jul 29, 2009, at 10:48 PM, Jon Nelson wrote: >> sure just use default=my_callable(ctx). the ctx contains the bind >> parameters for the current row. you could also just use a >> MapperExtension. > > I am not sure how to apply a default when not defining the columns - I > am sadly using d

[sqlalchemy] Re: strange problem with relation(..)

2009-07-29 Thread Jon Nelson
On Wed, Jul 29, 2009 at 9:16 PM, Michael Bayer wrote: > > On Jul 29, 2009, at 10:10 PM, BigJon wrote: > >> On Jul 21, 2:53 pm, "Michael Bayer" wrote: >>> >>> Jon Nelson wrote: >>> The parent_id is NOT NULL and has no default. Doing something like this doesn't seem to help, with or witho

[sqlalchemy] Re: Manually setting the polymorphic type

2009-07-29 Thread NoDamage
That seems easy enough, thanks! On Jul 28, 7:25 pm, Michael Bayer wrote: > On Jul 28, 2009, at 8:14 PM, NoDamage wrote: > > > > > > > Is it possible to manually set the type column of a base class when > > using single table inheritance? The reason I want to do this is > > because I am importing

[sqlalchemy] Re: declarative_base vs mapper

2009-07-29 Thread Mike Conley
> What are the advantages of using declarative way of setting table > definitions? vs > addressbook_table = sqlalchemy.Table("Addressbook", metadata, >sqlalchemy.Column('Address_Sid', sqlalchemy.Integer, primary_key=True), >sqlalchemy.Column('FirstName', sqlalchemy.Unicode(40),nullable=Fals

[sqlalchemy] Re: declarative_base vs mapper

2009-07-29 Thread Lukasz Szybalski
On Wed, Jul 29, 2009 at 4:34 PM, Lukasz Szybalski wrote: > Hello, > How can I do > Index('myindex', xyz.c.type, xyz.c.name, unique=True) > > in a declarative way? > > class xyz(DeclarativeBase): >    __tablename__ = 'xyz' > >    #{ Columns > >    type = Column(Unicode(), nullable=False) >    name

[sqlalchemy] Re: declarative_base vs mapper

2009-07-29 Thread Mike Conley
Here is one approach. I would like to see some way of embedding it in __table_args__, but I haven't been able to figure out that one. t_xyz = xyz.__table__ indx = Index('myindex', t_xyz.c.type, t_xyz.c.name, unique=True) indx.create() or if you put the first 2 lines before metadata.cr

[sqlalchemy] Re: README.unittests: missing command to setup.py

2009-07-29 Thread Michael Bayer
Jon Nelson wrote: > > I followed the instructions and they didn't work: > > The file README.unittests states: > > $ export PYTHONPATH=. > $ python setup.py -d . > > but this is what I get: > > usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] >or: setup.py --help [c

[sqlalchemy] README.unittests: missing command to setup.py

2009-07-29 Thread Jon Nelson
I followed the instructions and they didn't work: The file README.unittests states: $ export PYTHONPATH=. $ python setup.py -d . but this is what I get: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-c

[sqlalchemy] declarative_base vs mapper

2009-07-29 Thread Lukasz Szybalski
Hello, How can I do Index('myindex', xyz.c.type, xyz.c.name, unique=True) in a declarative way? class xyz(DeclarativeBase): __tablename__ = 'xyz' #{ Columns type = Column(Unicode(), nullable=False) name = Column(Unicode(), nullable=False) how do I do index declarative style?

[sqlalchemy] Re: logging after engine creation

2009-07-29 Thread Michael Bayer
Jon Nelson wrote: > > > interpolation. Even if we start out with loglevel=INFO but the log > statement is, say, DEBUG we still pay the interpolation penalty (for > things like repr or %r, easily far more expensive than the method > overhead). we have separate conditionals for INFO and DEBUG so if

[sqlalchemy] Re: logging after engine creation

2009-07-29 Thread Jon Nelson
On Wed, Jul 29, 2009 at 2:24 PM, Michael Bayer wrote: > > Jon Nelson wrote: >> I assume that the purpose of this is to save performance? > > correct. > >> I note that the way much of the logging (esp. in pool.py) seems to be >> written is like this: >> >> somelogger.log("String ..." % (var1,var2,v

[sqlalchemy] Re: logging after engine creation

2009-07-29 Thread Michael Bayer
Jon Nelson wrote: > I assume that the purpose of this is to save performance? correct. > I note that the way much of the logging (esp. in pool.py) seems to be > written is like this: > > somelogger.log("String ..." % (var1,var2,var3)) > and of course, regardless of the loglevel specified this al

[sqlalchemy] logging after engine creation

2009-07-29 Thread Jon Nelson
I was recently trying to change the logging from the default to INFO for sqlalchemy.engine. This works great - so long as I do it at startup, before I make any connections, etc, however once I've created my engine instance I don't seem to be able to change the logging level, at least not in the e

[sqlalchemy] Cloning an instance of a mapped class

2009-07-29 Thread Mike Conley
I have a need to clone an instance of a mapped class and insert the new instance in my database with only minor changes to attributes. To do this I want to create a new instance of the class with all non-key attributes copied from the old instance. Primary keys and foreign keys will be populated at

[sqlalchemy] Re: More SA, pyodbc, *nux and MSSQL problems

2009-07-29 Thread Ed Singleton
Stupidly forgot to attach the files. --~--~-~--~~~---~--~~ 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

[sqlalchemy] Re: More SA, pyodbc, *nux and MSSQL problems

2009-07-29 Thread Ed Singleton
On 25 Jul 2009, at 03:17, mtrier wrote: > On Jul 23, 8:30 am, Ed Singleton wrote: >> I've managed to get SA (0.6 branch) and pyodbc connecting to anMSSQL >> db on Mac OS X, but I've recently been trying to get it working on >> linux (Debian Lenny) and have been hitting some problems. >> >> It's d

[sqlalchemy] Re: Problems building 0.6 docs

2009-07-29 Thread Ed Singleton
Ah thanks, that seems to work fine now. Very grateful. For anyone googling this, "use the Makefile" means: $ cd doc/build $ make html Ed On 29 Jul 2009, at 16:26, Michael Bayer wrote: > > use the Makefile included in the dist > > > Ed Singleton wrote: >> >> I'm trying to build the docs for

[sqlalchemy] Re: single table inheritance through declarative.

2009-07-29 Thread Michael Bayer
rajasekhar911 wrote: > > Hi > > I am facing a different problem in inheritance. > I am using the single table inheritance through declarative. > http://www.sqlalchemy.org/docs/05/reference/ext/declarative.html#single-table-inheritance > > b=Base() > b.id='xxx' > b.name='xxx' > b.type='type1' > I a

[sqlalchemy] Re: Problems building 0.6 docs

2009-07-29 Thread Michael Bayer
use the Makefile included in the dist Ed Singleton wrote: > > I'm trying to build the docs for SA 0.6 on python2.6 on Mac. I've > assumed I need to use Sphinx (which obvously may be quite wrong of > me), so I've easy_installed Sphinx and Mako, and then I run the command: > > mkdir docs > sphinx

[sqlalchemy] Re: Attribute inheritance problem - IRC comment

2009-07-29 Thread Michael Bayer
Tefnet Developers wrote: > > [10:00] < jezier> stepz_: in for m in mapper.polymorphic_iterator(): you > get random order i think While I haven't tested this, based on inspection it should only be random within one level of hierarchy, which shouldn't cause this issue. e.g. D <- B <- A E <-

[sqlalchemy] Re: Attribute inheritance problem.

2009-07-29 Thread Michael Bayer
Tefnet Developers wrote: > > Dnia 2009-07-28, wto o godzinie 11:06 -0400, Michael Bayer pisze: > >> A few things here. First is, I'm not observing the extension not >> getting >> inherited. Task().result = 3 raises the error, DeliveryTask().result = >> 3 >> does not, and the value is assigned to

[sqlalchemy] single table inheritance through declarative.

2009-07-29 Thread rajasekhar911
Hi I am facing a different problem in inheritance. I am using the single table inheritance through declarative. http://www.sqlalchemy.org/docs/05/reference/ext/declarative.html#single-table-inheritance b=Base() b.id='xxx' b.name='xxx' b.type='type1' I am manually setting the type column of my ba

[sqlalchemy] Problems building 0.6 docs

2009-07-29 Thread Ed Singleton
I'm trying to build the docs for SA 0.6 on python2.6 on Mac. I've assumed I need to use Sphinx (which obvously may be quite wrong of me), so I've easy_installed Sphinx and Mako, and then I run the command: mkdir docs sphinx-build doc/build/ docs It appears to read in fine but then raises an

[sqlalchemy] Re: More SA, pyodbc, *nux and MSSQL problems

2009-07-29 Thread Ed Singleton
On 29 Jul 2009, at 05:43, Michael Trier wrote: > Hi > > On Tue, Jul 28, 2009 at 3:14 PM, Ed Singleton > wrote: > > On 26 Jul 2009, at 15:06, Michael Bayer wrote: > > > > > i have freetds 0.82, pyodbc 2.1.4. except for binary it mostly > works > > fine (with sqla 0.6). > > > Is that on Mac,

[sqlalchemy] Re: Attribute inheritance problem - IRC comment

2009-07-29 Thread Tefnet Developers
A short discussion from #sqlalchemy at freenode: [09:48] < filip> hi, could somebody please run http://filip.eu.org/sqlawtf.py and tell me whether an exception is being raised? [09:49] < filip> because on my machines it is, and on zzzeek's it is not... [09:55] < stepz_> filip: I looked at that

[sqlalchemy] Re: Attribute inheritance problem.

2009-07-29 Thread Tefnet Developers
Dnia 2009-07-28, wto o godzinie 11:06 -0400, Michael Bayer pisze: > A few things here. First is, I'm not observing the extension not getting > inherited. Task().result = 3 raises the error, DeliveryTask().result = 3 > does not, and the value is assigned to 3. This is with 0.5.5 as well as > tr