Re: [sqlalchemy] generating alter table statements for foreign key constraints by default

2014-08-27 Thread Bala Ramakrishnan
nts.html?highlight=after_parent_attach#sqlalchemy.events.DDLEvents.after_parent_attach > > > apply the event to ForeignKey and set use_alter=True for all of them as > they come in. > > > On Aug 26, 2014, at 10:03 PM, Bala Ramakrishnan > wrote: > > To generate an

[sqlalchemy] generating alter table statements for foreign key constraints by default

2014-08-26 Thread Bala Ramakrishnan
instead of setting them for each relationship? I am trying to find a comparable setting with Java Hibernate. -Bala -- 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

Re: [sqlalchemy] Updating children of a one-to-many bi-directional relationship

2014-07-22 Thread Bala Ramakrishnan
relationship > (where you say dev_part.device = ndev) together. SQLAlchemy’s > relationship management code knows nothing about any of those foreign key > sets. See > http://docs.sqlalchemy.org/en/rel_0_9/faq.html#i-set-the-foo-id-attribute-on-my-instance-to-7-but-the-foo-attrib

[sqlalchemy] Updating children of a one-to-many bi-directional relationship

2014-07-20 Thread Bala Ramakrishnan
I had asked this question on Stack Overflow. The details are at this link: http://stackoverflow.com/questions/24836816/updating-a-few-children-in-one-to-many-relationship-deletes-all-rows-and-adds-ne The summary is I have a parent class A and a bidirectional one-to-many relationship with class B

Re: [sqlalchemy] Issue with self-referential many-to-many

2014-03-11 Thread Bala Ramakrishnan
_ = (sa.UniqueConstraint('domain_id', 'group_name'),) Thanks for the help -Bala On Tuesday, March 11, 2014 4:39:54 PM UTC-7, Michael Bayer wrote: > > you need to name the “secondary” table as it’s name in the MetaData > collection, not the variable name you’ve assigne

Re: [sqlalchemy] Issue with self-referential many-to-many

2014-03-11 Thread Bala Ramakrishnan
On Tuesday, March 11, 2014 4:39:54 PM UTC-7, Michael Bayer wrote: > > you need to name the “secondary” table as it’s name in the MetaData > collection, not the variable name you’ve assigned it to, when configuring > with string arguments. > > > On Mar 11, 2014, at 6:50 PM,

Re: [sqlalchemy] Issue with self-referential many-to-many

2014-03-11 Thread Bala
izing mapper Mapper|Groups|groups, expression 'Groups.id==groups_and_groups_assoc_table.c.parent_group_id' failed to locate a name ("name 'groups_and_groups_assoc_table' is not defined"). If this is a class name, consider adding this relationship() to the class after both dependent cl

[sqlalchemy] Issue with self-referential many-to-many

2014-03-11 Thread Bala
I am using version 0.9.3. When defining a many-to-many self-referential relationship, I found that the primary key column has to be defined in the table itself. It cannot be defined in the model base or a mixin class from which this entity is derived. For example: Given these definitions:

Re: [sqlalchemy] 0.6 - unexpected keyword argument 'transactional'

2012-08-23 Thread Bala from Boston
l kwargs['transactional'] Apologies in advance if this topic has already been vetted and I missed it, or for any inefficiencies with my code, as I only started looking at SQLAlchemy (and Python for that matter) yesterday. Please feel free to modify and distribute as you see fit. Chee

[sqlalchemy] Delay in getting the response object and populating data to UI page using Python, SQLAlchemy, MySQL

2011-06-15 Thread Bala
def write(self, params): if 'id' in params: ticket = self.dao.FindByID(Ticket, params['id'][0]) ticket.modified = datetime.datetime.now() else: ticket = Ticket() # Mark ticket o