Tefnet Developers wrote:
>
> Dnia 2009-11-02, pon o godzinie 16:07 -0500, Michael Bayer pisze:
>
>> Providing AttributeExtension hooks to end users who can then write
>> custom
>> code without any attention to object/session state is never guaranteed
>> to
>> work completely.
>
> Um, that's not the case. We develop the extensions ourselves, it looks
> somewhat like this:
>
> SomeClass.someProp = tefobjects.properties.Integer(immutable = True,
> dependable = True)
>
> These kwargs cause appropiate extensions (already defined in tefobjects
> package) to be appended. People utilizing our API will in general use
> extensions on this level only.

>
>> Why isn't it an option, when granting users access to
>> AttributeExtension,
>> that you flush() their session first ?  you would then disable autoflush
>> temporarily at the Session level (just set the "autoflush" attribute on
>> it).
>
> Do you mean adding another layer of descriptors which would flush()
> before setting an sqlalchemy property? Well it is an option, but it
> would get things even more complicated and ugly. It would basically be a
> bloated workaround.

I attached to the ticket another case where issuing flush() in the middle
of an operation causes breakage - I can likely think of more.


> The patch I have suggested doesn't seem to be able
> to break anything, it seems more natural (at least for me) to call
> modify_event() in these places.

agreed that it is an improvement (even though it does not fix your use
case completely).  But the fact is if anyone is relying upon the behavior
of an attributes.get_history() call inside of an attribute extension,
moving the call to "modified_event()" to after the event will break that
code.   The change has the potential to be backwards incompatible and
doesn't seem appropriate for a maintenance release.  0.6 is required to be
released before mid-february for Pycon and beta releases some weeks before
then.



>
> I have attached a file showing the problem to the ticket 1601.
>
> regards,
> Filip Zyzniewski
>
>
> >
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to