[sqlalchemy] Using column name instead of key in constraints

2017-09-30 Thread Zac Goldstein
Is it possible to use column names instead of keys when creating table 
constraints?  I know ForeignKeyConstraint/ForeignKey have a link_to_name 
parameter which I've been able to use, but I haven't found a similar option 
for other constraints.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] Re: SQLAlchemy many-to-many Postgresql double delete

2017-09-30 Thread Tolstov Sergey
Mike, thanks for answer. But that's not true. I use them on project and it 
works. Ilja Everilä 
 on 
StackOverflow help me. Answer is:
I need a create functions.

In [6]: def class_name_collection(base, local_cls, referred_cls, constraint):
   ...: return referred_cls.__name__
   ...: 

and then

   ...: Base.prepare(engine, reflect=True,
   ...:  name_for_collection_relationship=class_name_collection)


Problem is - using Autobase with custom relationship preferences add 
objects to two collections, and try delete from all of them

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.