Referential integrity isn't being violated here - SA is nulling the foreign
key before deleting the row it points to. Try adding nullable=False to the
declaration of attivita.cod_specie. That should make it fail in the way you
expect, because SA will no longer be able to null the foreign key.
The pr_PurchaseRequisition_has_CELLS_budget_has_CELLS_costCenter table is
the one that's causing your problem. It has a foreign key to
CELLS_budget_has_CELLS_costCenter.CELLS_budget_ID (and another to
CELLS_costCenter_ID on the same table). Neither of those
two columns are unique. If you add
with ForeignKeyConstraint.
Search for it at
http://www.sqlalchemy.org/docs/metadata.myt.
So there is no solution to get it running with this requirement in
postgresql ? (except defining a new ID but I cannot change the schema)
On 15 Feb., 21:03, Gary Bernhardt [EMAIL PROTECTED] wrote
On 2/13/07, vinjvinj [EMAIL PROTECTED] wrote:
Found the answer:
# a function to create primary key ids
i = 0
def mydefault():
global i
i += 1
return i
This counter is going to start over every time you run your program. The
second time you run it, it's going to start
The Working with Large Collections section in the advanced mapping docs is
probably what you want:
http://www.sqlalchemy.org/docs/adv_datamapping.myt#advdatamapping_properties_working
On 2/13/07, Cristiano Paris [EMAIL PROTECTED] wrote:
I everyone. I'm pretty new to SQLAlchemy and never done
On 2/13/07, vinjvinj [EMAIL PROTECTED] wrote:
This counter is going to start over every time you run your program. The
second time you run it, it's going to start creating IDs that already
exist,
You missed my first post, which stated:
I most certainly did. My apologies. :)
I use the