on the load side in loading.py and on the persistence side in session.py
_register_newly_persistent.
On 04/20/2016 01:28 PM, Chris Withers wrote:
Hey All,
Where is InstanceState.key set?
I'm looking for the code that builds the key used in the identity_map of
the session. Turns out to be
Hey All,
Where is InstanceState.key set?
I'm looking for the code that builds the key used in the identity_map of
the session. Turns out to be not so easy to find...
Chris
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from
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')
>
>
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
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
from sqlalchemy.orm import aliased as _aliased
def aliased(entity):
return _aliased(entity, name=entity.__table_alias__)
?
On 04/20/2016 10:25 AM, SPetro wrote:
Hi, is possible to have "default" alias for table
class Cwle(Base):
__tablename__ = 'CardiacWaitListEntry'
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
On 04/20/2016 07:35 AM, Piotr Dobrogost wrote:
Having this code
class Base(object):
@declared_attr
def __tablename__(cls):
return '{0}s'.format(camel_case_to_name(cls.__name__))
class Model(Base):
id = Column(Integer, Sequence(???, optional=True), primary_key=True)
is
I had an unnamed UniqueConstraint, and autogenerated upgrade scripts that
passed in None as the name - these worked perfectly. Now I am discovering
that the downgrade doesn't work, as there is no name to refer to the
constraint (i.e. "sqlalchemy.exc.CompileError: Can't emit DROP CONSTRAINT
for
Having this code
class Base(object):
@declared_attr
def __tablename__(cls):
return '{0}s'.format(camel_case_to_name(cls.__name__))
class Model(Base):
id = Column(Integer, Sequence(???, optional=True), primary_key=True)
is there a way to use name of Model's table inside
10 matches
Mail list logo