On 9/10/15 8:48 AM, Pavel S wrote:
Let's say, I have declarative classes A, B, C, D.
A is the parent
B has FK to A
C has FK to B,
D has FK to C etc...
I'd like to implement _generic method_ walk(obj) which will
recursively yield dependent/related objects of obj (which is instance
of A).
Hi Michael, this is amazing, thanks!!!
On Thursday, September 10, 2015 at 3:35:39 PM UTC+2, Michael Bayer wrote:
>
>
>
> On 9/10/15 8:48 AM, Pavel S wrote:
>
> Let's say, I have declarative classes A, B, C, D.
>
> A is the parent
> B has FK to A
> C has FK to B,
> D has FK to C etc...
>
> I'd
Let's say, I have declarative classes A, B, C, D.
A is the parent
B has FK to A
C has FK to B,
D has FK to C etc...
I'd like to implement *generic method* walk(obj) which will recursively
yield dependent/related objects of obj (which is instance of A).
I know that there is introspection
On 10.9.2015 16:30, Mike Bayer wrote:
> On 9/10/15 10:26 AM, Mike Bayer wrote:
>>
>>
>> On 9/10/15 10:13 AM, Ladislav Lenart wrote:
>>> Hello.
>>>
>>> Just a really, really tiny and pedantic correction... The stack
>>> variable in the
>>> code is in fact a queue. This could potentially surprise
thanks Michael, exactly the path I took ... cheers
On Tuesday, September 8, 2015 at 12:04:58 PM UTC-4, Michael Bayer wrote:
>
>
>
> On 9/8/15 9:32 AM, murray...@lightspeedretail.com wrote:
>
> Hi there,
>
> Is there any way I can set additional params on alembic.op.create_index.
> We are using
On 9/10/15 9:35 AM, Mike Bayer wrote:
On 9/10/15 8:48 AM, Pavel S wrote:
Let's say, I have declarative classes A, B, C, D.
A is the parent
B has FK to A
C has FK to B,
D has FK to C etc...
I'd like to implement _generic method_ walk(obj) which will
recursively yield dependent/related
On 9/10/15 10:26 AM, Mike Bayer wrote:
On 9/10/15 10:13 AM, Ladislav Lenart wrote:
Hello.
Just a really, really tiny and pedantic correction... The stack
variable in the
code is in fact a queue. This could potentially surprise some users /
readers.
To fix, please do one of the
Hello.
Just a really, really tiny and pedantic correction... The stack variable in the
code is in fact a queue. This could potentially surprise some users / readers.
To fix, please do one of the following:
* Rename stack local var to queue.
* Use stack.pop() to pop the last element from the
In the meanwhile, I've implemented similar:
def walk(obj, level=0, memo=None):
memo = memo or set()
if obj not in memo:
yield level, obj
memo.add(obj)
insp = inspect(obj)
for relationship in insp.mapper.relationships:
On 9/10/15 10:13 AM, Ladislav Lenart wrote:
Hello.
Just a really, really tiny and pedantic correction... The stack variable in the
code is in fact a queue. This could potentially surprise some users / readers.
To fix, please do one of the following:
* Rename stack local var to queue.
* Use
Hi Michael,
Thanks for your response. It helped a lot. I ended up going with the
quick and dirty query.from_obj[0] method you described. That was faster to
implement and served my purposes exactly.
Cheers, Brian
>
>
--
You received this message because you are subscribed to the Google
11 matches
Mail list logo