Re: [sqlalchemy] Question about @validates decorator

2011-07-29 Thread Michael Bayer

On Jul 29, 2011, at 8:34 AM, Stefano Fontanelli wrote:

> Il 28/07/11 21.17, Michael Bayer ha scritto:
>> h well there's not a public API for that.   Right now (and with no 
>> immediate plans to change it) the function should have an attribute called 
>> "__sa_validators__" which is a list of attribute names.Ultimately there 
>> are attribute events assigned though the event API doesn't have a documented 
>> introspection interface (yet) either.
>> 
> 
> Yes, I read the code of 'validates' decorator function and I found 
> '__sa_validators__'.
> About attribute events... I will read the code next weekend.
> My hope? The existence of a public API :)
> It is not a problem... Are you interested in a patch?
> 
> Thank you for the great support.

I'm interested in lots and lots of patches, with tests that can go straight 
into our test suite (since I generally don't commit code that isn't covered by 
at least a simple test, and most of the work in new patches is writing the 
tests, not the feature) :) , yes.

-- 
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.



Re: [sqlalchemy] Question about @validates decorator

2011-07-29 Thread Stefano Fontanelli

Il 28/07/11 21.17, Michael Bayer ha scritto:

h well there's not a public API for that.   Right now (and with no immediate plans to 
change it) the function should have an attribute called "__sa_validators__" 
which is a list of attribute names.Ultimately there are attribute events assigned 
though the event API doesn't have a documented introspection interface (yet) either.



Yes, I read the code of 'validates' decorator function and I found 
'__sa_validators__'.

About attribute events... I will read the code next weekend.
My hope? The existence of a public API :)
It is not a problem... Are you interested in a patch?

Thank you for the great support.

Regards,
Stefano.

--
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.



Re: [sqlalchemy] Question about @validates decorator

2011-07-28 Thread Michael Bayer
h well there's not a public API for that.   Right now (and with no 
immediate plans to change it) the function should have an attribute called 
"__sa_validators__" which is a list of attribute names.Ultimately there are 
attribute events assigned though the event API doesn't have a documented 
introspection interface (yet) either.


On Jul 28, 2011, at 1:27 PM, Stefano Fontanelli wrote:

> 
> Hi folks,
> I'm working on a project which uses SQLAlchemy as ORM layer and I have a 
> question about @validates decorator.
> 
> How can I get a list of functions (in each entity of my model) that are 
> decorated using sqlalchemy.orm.validates decorator?
> 
> 
> Regards,
> Stefano.
> 
> 
> -- 
> 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.
> 

-- 
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.



[sqlalchemy] Question about @validates decorator

2011-07-28 Thread Stefano Fontanelli


Hi folks,
I'm working on a project which uses SQLAlchemy as ORM layer and I have a 
question about @validates decorator.


How can I get a list of functions (in each entity of my model) that are 
decorated using sqlalchemy.orm.validates decorator?



Regards,
Stefano.


--
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.