Re: [sqlalchemy] Re: Hybrid Property vs Hybrid Method Expression Names

2018-10-04 Thread Mike Bayer
a PR would at least remind me to look into it even if i dont use your
suggested verbiage as is, thanks!
On Thu, Oct 4, 2018 at 4:07 AM  wrote:
>
> To follow this up - what would be the best way to get these extra dragons in? 
> I would be happy to submit a PR or something if that is easier.
>
> On Friday, September 14, 2018 at 10:32:52 AM UTC+2, ja...@cryptosense.com 
> wrote:
>>
>> Thanks for the help - I had missed the "copy vs modifying in place" 
>> difference between hybrid_method and hybrid_property.
>>
>> I think adding another dragon would be helpful here, probably located in 
>> http://docs.sqlalchemy.org/en/latest/orm/extensions/hybrid.html#defining-expression-behavior-distinct-from-attribute-behavior.
>>  I'm happy to move this thread into a docs issue if that would be helpful.
>>
>> On Thursday, September 13, 2018 at 5:45:05 PM UTC+2, Mike Bayer wrote:
>>>
>>> On Thu, Sep 13, 2018 at 7:55 AM,   wrote:
>>> > Update: I have just found
>>> > http://docs.sqlalchemy.org/en/latest/changelog/migration_12.html#hybrid-attributes-support-reuse-among-subclasses-redefinition-of-getter
>>> > which documents that getters and setters must have the same name as the
>>> > original expression.
>>> >
>>> > Can I just check that it is expected for expressions to have this
>>> > requirement? If so, is it worth opening a docs issue to add this to the 
>>> > main
>>> > hybrid property docs?
>>>
>>> this is the mechanics of Python, when you say:
>>>
>>> @mything.foobar
>>> def _myotherthing(...)
>>>
>>>
>>> you are assigning to the name "_myotherthing".   Since
>>> @hybrid_property now creates a copy when any modifier is called, the
>>> original hybrid you have at "mything" was not changed.
>>>
>>> All the documentation examples at
>>> http://docs.sqlalchemy.org/en/latest/orm/extensions/hybrid.html
>>> indicate using the same method name for each modification.I can
>>> add more dragons to the hybrid docs as well clarifying that this
>>> naming scheme is intentional and required, if that helps.
>>>
>>>
>>>
>>> >
>>> > --
>>> > SQLAlchemy -
>>> > The Python SQL Toolkit and Object Relational Mapper
>>> >
>>> > http://www.sqlalchemy.org/
>>> >
>>> > To post example code, please provide an MCVE: Minimal, Complete, and
>>> > Verifiable Example. See http://stackoverflow.com/help/mcve for a full
>>> > description.
>>> > ---
>>> > You received this message because you are subscribed to the Google Groups
>>> > "sqlalchemy" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send an
>>> > email to sqlalchemy+...@googlegroups.com.
>>> > To post to this group, send email to sqlal...@googlegroups.com.
>>> > Visit this group at https://groups.google.com/group/sqlalchemy.
>>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> ---
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Re: Hybrid Property vs Hybrid Method Expression Names

2018-10-04 Thread james
To follow this up - what would be the best way to get these extra dragons 
in? I would be happy to submit a PR or something if that is easier.

On Friday, September 14, 2018 at 10:32:52 AM UTC+2, ja...@cryptosense.com 
wrote:
>
> Thanks for the help - I had missed the "copy vs modifying in place" 
> difference between hybrid_method and hybrid_property.
>
> I think adding another dragon would be helpful here, probably located in 
> http://docs.sqlalchemy.org/en/latest/orm/extensions/hybrid.html#defining-expression-behavior-distinct-from-attribute-behavior.
>  
> I'm happy to move this thread into a docs issue if that would be helpful.
>
> On Thursday, September 13, 2018 at 5:45:05 PM UTC+2, Mike Bayer wrote:
>>
>> On Thu, Sep 13, 2018 at 7:55 AM,   wrote: 
>> > Update: I have just found 
>> > 
>> http://docs.sqlalchemy.org/en/latest/changelog/migration_12.html#hybrid-attributes-support-reuse-among-subclasses-redefinition-of-getter
>>  
>> > which documents that getters and setters must have the same name as the 
>> > original expression. 
>> > 
>> > Can I just check that it is expected for expressions to have this 
>> > requirement? If so, is it worth opening a docs issue to add this to the 
>> main 
>> > hybrid property docs? 
>>
>> this is the mechanics of Python, when you say: 
>>
>> @mything.foobar 
>> def _myotherthing(...) 
>>
>>
>> you are assigning to the name "_myotherthing".   Since 
>> @hybrid_property now creates a copy when any modifier is called, the 
>> original hybrid you have at "mything" was not changed. 
>>
>> All the documentation examples at 
>> http://docs.sqlalchemy.org/en/latest/orm/extensions/hybrid.html 
>> indicate using the same method name for each modification.I can 
>> add more dragons to the hybrid docs as well clarifying that this 
>> naming scheme is intentional and required, if that helps. 
>>
>>
>>
>> > 
>> > -- 
>> > SQLAlchemy - 
>> > The Python SQL Toolkit and Object Relational Mapper 
>> > 
>> > http://www.sqlalchemy.org/ 
>> > 
>> > To post example code, please provide an MCVE: Minimal, Complete, and 
>> > Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
>> > description. 
>> > --- 
>> > You received this message because you are subscribed to the Google 
>> Groups 
>> > "sqlalchemy" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an 
>> > email to sqlalchemy+...@googlegroups.com. 
>> > To post to this group, send email to sqlal...@googlegroups.com. 
>> > Visit this group at https://groups.google.com/group/sqlalchemy. 
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Re: Hybrid Property vs Hybrid Method Expression Names

2018-09-14 Thread james
Thanks for the help - I had missed the "copy vs modifying in place" 
difference between hybrid_method and hybrid_property.

I think adding another dragon would be helpful here, probably located in 
http://docs.sqlalchemy.org/en/latest/orm/extensions/hybrid.html#defining-expression-behavior-distinct-from-attribute-behavior.
 
I'm happy to move this thread into a docs issue if that would be helpful.

On Thursday, September 13, 2018 at 5:45:05 PM UTC+2, Mike Bayer wrote:
>
> On Thu, Sep 13, 2018 at 7:55 AM,  > 
> wrote: 
> > Update: I have just found 
> > 
> http://docs.sqlalchemy.org/en/latest/changelog/migration_12.html#hybrid-attributes-support-reuse-among-subclasses-redefinition-of-getter
>  
> > which documents that getters and setters must have the same name as the 
> > original expression. 
> > 
> > Can I just check that it is expected for expressions to have this 
> > requirement? If so, is it worth opening a docs issue to add this to the 
> main 
> > hybrid property docs? 
>
> this is the mechanics of Python, when you say: 
>
> @mything.foobar 
> def _myotherthing(...) 
>
>
> you are assigning to the name "_myotherthing".   Since 
> @hybrid_property now creates a copy when any modifier is called, the 
> original hybrid you have at "mything" was not changed. 
>
> All the documentation examples at 
> http://docs.sqlalchemy.org/en/latest/orm/extensions/hybrid.html 
> indicate using the same method name for each modification.I can 
> add more dragons to the hybrid docs as well clarifying that this 
> naming scheme is intentional and required, if that helps. 
>
>
>
> > 
> > -- 
> > SQLAlchemy - 
> > The Python SQL Toolkit and Object Relational Mapper 
> > 
> > http://www.sqlalchemy.org/ 
> > 
> > To post example code, please provide an MCVE: Minimal, Complete, and 
> > Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> > description. 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sqlalchemy" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to sqlalchemy+...@googlegroups.com . 
> > To post to this group, send email to sqlal...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/sqlalchemy. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Re: Hybrid Property vs Hybrid Method Expression Names

2018-09-13 Thread Mike Bayer
On Thu, Sep 13, 2018 at 7:55 AM,   wrote:
> Update: I have just found
> http://docs.sqlalchemy.org/en/latest/changelog/migration_12.html#hybrid-attributes-support-reuse-among-subclasses-redefinition-of-getter
> which documents that getters and setters must have the same name as the
> original expression.
>
> Can I just check that it is expected for expressions to have this
> requirement? If so, is it worth opening a docs issue to add this to the main
> hybrid property docs?

this is the mechanics of Python, when you say:

@mything.foobar
def _myotherthing(...)


you are assigning to the name "_myotherthing".   Since
@hybrid_property now creates a copy when any modifier is called, the
original hybrid you have at "mything" was not changed.

All the documentation examples at
http://docs.sqlalchemy.org/en/latest/orm/extensions/hybrid.html
indicate using the same method name for each modification.I can
add more dragons to the hybrid docs as well clarifying that this
naming scheme is intentional and required, if that helps.



>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full
> description.
> ---
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] Re: Hybrid Property vs Hybrid Method Expression Names

2018-09-13 Thread james
Update: I have just found 
http://docs.sqlalchemy.org/en/latest/changelog/migration_12.html#hybrid-attributes-support-reuse-among-subclasses-redefinition-of-getter
 
which documents that getters and setters must have the same name as the 
original expression.

Can I just check that it is expected for expressions to have this 
requirement? If so, is it worth opening a docs issue to add this to the 
main hybrid property docs?

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.