Michael Bayer wrote:
> 
> On Dec 16, 2007, at 3:26 PM, [EMAIL PROTECTED] wrote:
> 
>> and another issue around attribute.get_history...
>> i have a descriptor that is autosetting some defaultvalue at first  
>> get.
> 
> a descriptor on top of the InstrumentedAttribute itself ?  id wonder  
> how you are configuring that.
under IA. in the __dict__ (which is not a dict at all).

>> ScalarObjectAttributeImpl never knows that the attribute has been  
>> missing at
>> start - dict.get(key,NOVALUE) will never return NOVALUE, as
>> the descriptor machinery is called instead of __dict__[key] / haskey  
>> etc.
> 
> if you really want a "default on first get" value, and youre riding  
> directly on top of the IA instead of using a differently-named  
> attribute for your own descriptor like all the docs say to do, 
yes and no, as i said i'm replacing the __dict__ with something special; so 
its IA riding on top of me (;-) but otherwise its that. no renaming, i dont 
want someone (thats can be me, later) to be able to workaround either me or SA.

> you  
> should use the callable mechanisms built into the attributes package,  
> although the new value created becomes the "committed" state so maybe  
> thats not what you want.  im confused, someone issues "print  
> object.foo", then it inserts some new data instead of not doing  
> anything ?  what if nobody "gets" the attribute ?
then it remains unset (None, null, whatever).
and i have a.b.c.d = 3 where b and c are auto-created (if declared so of course)
as for autoinsert -- what people write is what people get.

i know it may be confusing; its a sort of declarative attribute-type 
metainfo, with validation, conversion, readonly, autoset, default-value, 
optional'ism, hints about UI/str/whatever representation, comment etc etc). 
And static-typing/static-attribute-set of course. db-business objects should 
not have any random stuff hanging on them.
trouble is it partialy duplicates some SA features so there is a conflict of 
interests, since day one of their meeting.
i was thinking about splitting it into two and putting one part above IA 
using those renamed columns approach and the rest underneath but that would 
be lots of work.
later
svilen

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to