[sqlalchemy] Re: __table_alias__ option

2016-04-20 Thread SPetro
Thank you

On Wednesday, April 20, 2016 at 10:25:43 AM UTC-4, SPetro wrote:
>
> Hi, is possible to have "default" alias for table
>
> class Cwle(Base):
> __tablename__ = 'CardiacWaitListEntry'
> __table_alias__ = 'CWLE'
>
> I know you can do this
> Cwle = aliased(Cwle, name='CWLE')
>
> but this screw up any editor intellisense. Output of sqalchemy query would 
> be more readable and what we use as convention.
>  
>
>
>
>
>
>
>
>

-- 
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: __table_alias__ option

2016-04-20 Thread Mike Bayer


if intellisense is scanning source code to determine what elements an 
object has, then I don't see any way for it to do this unless you 
actually typed in a new definition of some kind that laid out all the 
attributes you'd like intellisense to know about.   IMO such tools are 
not practical for dynamic languages like Python.




On 04/20/2016 10:33 AM, SPetro wrote:

Hi , but how would you write query with this, this is what I want

class Cwle(Base):
 __tablename__ = 'CardiacWaitListEntry'
 wleid = Column('WaitlistEntryID',NUMERIC(18), primary_key=True)

qr = session.query(Cwle.wleid)  <--- when I type Cwle. it will bring
intellisense with all columns (there are a lot of them :) )

select CWLE.wleid from CardiacWaitListEntry  as  CWLE


On Wednesday, April 20, 2016 at 10:25:43 AM UTC-4, SPetro wrote:

Hi, is possible to have "default" alias for table

class Cwle(Base):
 __tablename__ = 'CardiacWaitListEntry'
 __table_alias__ = 'CWLE'

I know you can do this
Cwle = aliased(Cwle, name='CWLE')

but this screw up any editor intellisense. Output of sqalchemy query
would be more readable and what we use as convention.







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


--
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: __table_alias__ option

2016-04-20 Thread SPetro
Hi , but how would you write query with this, this is what I want

class Cwle(Base):
__tablename__ = 'CardiacWaitListEntry'
wleid = Column('WaitlistEntryID',NUMERIC(18), primary_key=True)

qr = session.query(Cwle.wleid)  <--- when I type Cwle. it will bring 
intellisense with all columns (there are a lot of them :) )

select CWLE.wleid from CardiacWaitListEntry  as  CWLE


On Wednesday, April 20, 2016 at 10:25:43 AM UTC-4, SPetro wrote:
>
> Hi, is possible to have "default" alias for table
>
> class Cwle(Base):
> __tablename__ = 'CardiacWaitListEntry'
> __table_alias__ = 'CWLE'
>
> I know you can do this
> Cwle = aliased(Cwle, name='CWLE')
>
> but this screw up any editor intellisense. Output of sqalchemy query would 
> be more readable and what we use as convention.
>  
>
>
>
>
>
>
>
>

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