[sqlalchemy] cardinality 1:1

2008-12-09 Thread az
hi. in SA, 1:1 is represented as relation( ...uselist=False, backref( ... uselist=False)). The question is, can that cardinality be enforced somehow - AFAIK that backref is not a real back-link in the DB. --~--~-~--~~~---~--~~ You received this message because

[sqlalchemy] Re: case_sensitive

2008-12-09 Thread jo
Maybe I'm using the 'case_sensitive' in a wrong way. Here what I want to reach : create unique index myname on mytable (lower(mycolumn)); How can I create it on sqlalachemy? j Glauco ha scritto: jo ha scritto: Hi all, Trying to migrate from 0.3.10 to 0.5 I have this error:

[sqlalchemy] Re: small inheritance problem

2008-12-09 Thread az
not sure if that is the problem, but are Folder.items and FolterContent.folder the reciprocal ends of same relation? then u need only one of those, with backref. On Tuesday 09 December 2008 12:08:02 Julien Cigar wrote: Dear SQLAlchemy users, I'm playing with inheritance for a CMS-like

[sqlalchemy] small inheritance problem

2008-12-09 Thread Julien Cigar
Dear SQLAlchemy users, I'm playing with inheritance for a CMS-like application. It's very usefull as it greatly simplifies the code. Here is my SQL script http://pastebin.com/f7c5297c8 and here is my python code (mappers, etc) http://pastebin.com/f1e2738ba (Not everything is shown...) As you

[sqlalchemy] Re: case_sensitive

2008-12-09 Thread Glauco
jo ha scritto: Hi all, Trying to migrate from 0.3.10 to 0.5 I have this error: sqlalchemy.exc.ArgumentError: Unknown UniqueConstraint argument(s): 'case_sensitive' how can I define the case_sensitive=True for a unique constraint? thank you, j

[sqlalchemy] Re: small inheritance problem

2008-12-09 Thread az
more things, u have polymorhism, but u do not specify identity for Content; and things that look like many to one are one to many (type). attached is the model as i understood it, expressed in dbcook; and the SA-setup generated by it (tables+mappers). see for yourself if u have anything else

[sqlalchemy] Example of Using SQLAlchemy to Connect to Microsoft SQL Server 2005 via Trusted Connections

2008-12-09 Thread Keyton Weissinger
Greetings all. I'm new to sqlalchemy and would REALLY like to use it at my office. I'm looking for examples and having a HECK of a time. 1. Running Python 2.5.2 on Windows XP. 2. Connecting to a local instance of SQL Server 2005. 3. Want to use **trusted connections** so others can run the

[sqlalchemy] Re: Example of Using SQLAlchemy to Connect to Microsoft SQL Server 2005 via Trusted Connections

2008-12-09 Thread Empty
Hello, On Tue, Dec 9, 2008 at 9:19 AM, Keyton Weissinger [EMAIL PROTECTED] wrote: Greetings all. I'm new to sqlalchemy and would REALLY like to use it at my office. I'm looking for examples and having a HECK of a time. 1. Running Python 2.5.2 on Windows XP. 2. Connecting to a local

[sqlalchemy] Session insert issues with a new dialect.

2008-12-09 Thread Dusty Phillips
I'm trying to fix/finish a half-broken dialect for OpenBase that was handed to me. I haven't gotten so far as using the SQLAlchemy test suite yet (OpenBase makes unit testing hard because a sequence of Create/drop messages deadlocks the db server, which is what tests normally do in setUp and

[sqlalchemy] Re: small inheritance problem

2008-12-09 Thread Julien Cigar
The thing is that Content is a kind of abstract, I never add Content directly but rather objects which inherits of Content. I'll take a look at your scripts, thanks ! Julien On Tue, 2008-12-09 at 16:06 +0200, [EMAIL PROTECTED] wrote: more things, u have polymorhism, but u do not specify

[sqlalchemy] Re: Example of Using SQLAlchemy to Connect to Microsoft SQL Server 2005 via Trusted Connections

2008-12-09 Thread Keyton Weissinger
Yep. Doesn't cover trusted connections, unfortunately. On Tue, Dec 9, 2008 at 9:24 AM, Empty [EMAIL PROTECTED] wrote: Hello, On Tue, Dec 9, 2008 at 9:19 AM, Keyton Weissinger [EMAIL PROTECTED] wrote: Greetings all. I'm new to sqlalchemy and would REALLY like to use it at my office. I'm

[sqlalchemy] Re: case_sensitive

2008-12-09 Thread Michael Bayer
I think this would involve sending func.lower(table.c.somecolumn) to the Index construct. On Dec 9, 2008, at 5:50 AM, jo wrote: Maybe I'm using the 'case_sensitive' in a wrong way. Here what I want to reach : create unique index myname on mytable (lower(mycolumn)); How can I create it

[sqlalchemy] Re: Example of Using SQLAlchemy to Connect to Microsoft SQL Server 2005 via Trusted Connections

2008-12-09 Thread Michael Bayer
how would you establish a trusted connection using straight pyodbc ? SQLA's URL should allow any number of arguments straight through to pyodbc, and if not, there are documented methods of giving the SQLA engine a connection factory that does whatever is needed in order to connect. On

[sqlalchemy] Re: cardinality 1:1

2008-12-09 Thread Michael Bayer
place a unique index on the foreign key column. though the ORM might not know how to update this correctly - you might need a mapper extension that nulls out the column when an old member is detached and a new member attached. On Dec 9, 2008, at 5:27 AM, [EMAIL PROTECTED] wrote: hi.

[sqlalchemy] Re: Session insert issues with a new dialect.

2008-12-09 Thread Michael Bayer
On Dec 9, 2008, at 9:30 AM, Dusty Phillips wrote: After perusing the sqlalchemy sources, I realized that when session.commit() is called, it is indeed inserting the data into the database, but it is not updating the _rowid primary key on the User object that was created. The user object

[sqlalchemy] Re: Extending sqlalchemy.schema.Column and metaprogramming traps

2008-12-09 Thread Angri
I can not agree that extending is safe as I've encountered another problem with custom class name: http://www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/lib/sqlalchemy/sql/util.py#L145 And I guess it is not the last :( I see, you propose not to extend class Column and write a function that

[sqlalchemy] Re: Extending sqlalchemy.schema.Column and metaprogramming traps

2008-12-09 Thread Michael Bayer
On Dec 9, 2008, at 4:09 PM, Angri wrote: I can not agree that extending is safe as I've encountered another problem with custom class name: http://www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/lib/sqlalchemy/sql/util.py#L145 And I guess it is not the last :( It probably is the last.

[sqlalchemy] Re: MSSQL null column definitions

2008-12-09 Thread desmaj
There's now a ticket that addresses this, along with a patch: http://www.sqlalchemy.org/trac/ticket/1243 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

[sqlalchemy] Re: Extending sqlalchemy.schema.Column and metaprogramming traps

2008-12-09 Thread Michael Bayer
On Dec 9, 2008, at 4:09 PM, Angri wrote: I can not agree that extending is safe as I've encountered another problem with custom class name: http://www.sqlalchemy.org/trac/browser/sqlalchemy/trunk/lib/sqlalchemy/sql/util.py#L145 rev 5454 removes AnnotatedColumn's reliance upon names within

[sqlalchemy] Re: Extending sqlalchemy.schema.Column and metaprogramming traps

2008-12-09 Thread Michael Bayer
On Dec 9, 2008, at 4:09 PM, Angri wrote: particularly explicitly define class properties (inheritable class properties!) if you'd like to submit a patch which defines __visit_name__ for all ClauseElements and removes the logic from VisitableType to guess the name, it will be accepted.

[sqlalchemy] Re: Extending sqlalchemy.schema.Column and metaprogramming traps

2008-12-09 Thread az
On Wednesday 10 December 2008 00:42:14 Michael Bayer wrote: On Dec 9, 2008, at 4:09 PM, Angri wrote: particularly explicitly define class properties (inheritable class properties!) if you'd like to submit a patch which defines __visit_name__ for all ClauseElements and removes the logic

[sqlalchemy] Re: case_sensitive

2008-12-09 Thread jose
I tried it, as you suggested me, Michael... Index('valuta_desc_uniq', func.lower(valuta.c.descrizione), unique=True) File /usr/lib/python2.4/site-packages/sqlalchemy/schema.py, line 1045, in __init__ self._init_items(*columns) File