Thanks Gaetan,

On Tue, Mar 24, 2009 at 00:21, Gaetan de Menten <[email protected]> wrote:
>
> On Sun, Mar 22, 2009 at 01:41, Danny W. Adair <[email protected]> 
> wrote:
>
>> (Sorry I couldn't figure out how to register for trac issue creation.)
>
> You can't register yourself, but you can report issues as "guest/guest".

Thanks for the info.
I'll report the issue when I have a patch... :-)

>
>> Trying to use Entity.to_dict() I've noticed that anything in "deep"
>> will be recursively be to_dict'()ed which breaks if it happens to be
>> None. I think it's more useful to allow the entries in "deep" to
>> either be an Entity or None. I want to to_dict() a relationship only
>> _if_ it is set.
>
> That was an oversight. I've just fixed it in trunk (r448). Thanks for
> reporting this.

Thanks.

>
>> Also:
>> - Is there a simple way to build that "deep" tree automatically from
>> my model, if I happen to want to resolve _all_ ManyToOne and OneToOne
>> relationships in the entity? I don't have circular problems and just
>> want "all".
>
> Not that I know of. It's not particularly hard to do though.
> Introducing such behavior *might* be a good idea. Maybe if "deep ==
> True". What do people think about this?

I think it's a great idea. :-)
I'll put it in a patch.

>
>> - It would be nice if entities resolved through "deep" had their
>> corresponding (fk) ids removed.
>
> This could be interesting as an option (and which should default to
> "off" IMO). Patch welcome ;-).

Will put that in, too.

>
>> - Couldn't "exclude" be a nested dict like "deep", rather than a list?
>
> This makes a lot of sense. The current behavior is broken and we
> should indeed add a mechanism to specify "deep" excludes. Patch
> welcome too...

I'll write a patch that works for me - I don't understand the FIXME
line (yet) so that deficiency might remain in my patched version.

>
>> (and just extended with the remote_side stuff)
>
> I'm not sure I understand what you mean here...

I'm referring to the lines:
    fks = self.mapper.get_property(rname).remote_side
    exclude = [c.name for c in fks]

where instead of "deep excludes" the back referrals get auto-excluded.
That's useful behaviour and should be imho implicit once there are
"deep excludes".
So maybe I should have said "update" cos it will become a dictionary :-)

See upcoming patch.

>
>[...]

Cheers,
Danny

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to