Re: [sqlalchemy] Parent object from collection class

2017-07-26 Thread Asif Mahmud
Thank you so much to take the time for helping me out. Best wishes - Asif Mahmud Shimon On Thu, Jul 27, 2017 at 3:37 AM, Mike Bayer <mike...@zzzcomputing.com> wrote: > On Wed, Jul 26, 2017 at 5:22 PM, Asif Mahmud <ams.ee...@gmail.com> wrote: > > So, doing

Re: [sqlalchemy] Parent object from collection class

2017-07-26 Thread Asif Mahmud
So, doing it like this - *parent = collections.collection_adapter(self).owner_state.obj()* where self is the collection object. is it correct? Best wishes - Asif Mahmud Shimon On Thu, Jul 27, 2017 at 3:16 AM, Mike Bayer <mike...@zzzcomputing.com> wrote: > On Wed, Jul 26, 2017 at 5:15

Re: [sqlalchemy] Parent object from collection class

2017-07-26 Thread Asif Mahmud
I walked through the dir of self and found this statement is the parent object - *self._sa_adapter.owner_state.object *. Is it safe to use this object for making more queries inside append method? Best wishes - Asif Mahmud Shimon On Thu, Jul 27, 2017 at 1:32 AM, Mike Bayer <c

[sqlalchemy] Parent object from collection class

2017-07-26 Thread Asif Mahmud
Hi, Is there a way to get/retrieve the parent object from a collection class's append/add method ? -- 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

[sqlalchemy] Friend circle by SQLAlchemy

2017-07-25 Thread Asif Mahmud
Say i have the following Users model- class Users(Base): __tablename__='users' id=Column(Integer, primary=True) friends=relationship( 'Users', secondary='friend_associations', primaryjoin='and_(FriendAssociations.user_id==Users.id,'

Re: [sqlalchemy] after_update for ARRAY types

2017-03-14 Thread Asif Mahmud
test = TestArrayTable() test.values = [x for x in range(5)] session.add(test) session.flush() for x in range(5, 10): test.values.append(x) session.flush() Thanks again - Asif Mahmud Shimon On Mon, Mar 13, 2017 at 7:12 PM mike bayer <mike...@zzzcomputing.com> wrote: > ARRAY n

[sqlalchemy] after_update for ARRAY types

2017-03-12 Thread Asif Mahmud
Hi, I'm not sure if it's a bug or I'm missing something. The thing is, I tried to register to *after_update ORM event to watch out for changes made to an existing row entry which has ARRAY *type column in it. But the event isn't firing when I append something to the *ARRAY *. Is this normal