On Tue, Dec 22, 2020 at 2:53 PM Mike Bayer wrote:
>
>
>
> On Tue, Dec 22, 2020, at 2:15 PM, Larry Martell wrote:
>
> I would think:
>
> su = session.query(ServerUtilization).filter(ServerUtilization.serverName
> == "server1").one()
>
> would use the data from ServerUtilization only. Does SQLA
On Tue, Dec 22, 2020, at 2:15 PM, Larry Martell wrote:
> I would think:
>
> su = session.query(ServerUtilization).filter(ServerUtilization.serverName
> == "server1").one()
>
> would use the data from ServerUtilization only. Does SQLA implicitly
> join the 2 tables even if no columns from
I would think:
su = session.query(ServerUtilization).filter(ServerUtilization.serverName
== "server1").one()
would use the data from ServerUtilization only. Does SQLA implicitly
join the 2 tables even if no columns from Server are referenced?
On Tue, Dec 22, 2020 at 1:57 PM Mike Bayer wrote:
>
it's important to distinguish between "Python attributes" and "database table
columns", these are two separate things.
Both tables in your database may have a column named "updatedDate". There is
no restriction on database table structure.
Your ServerUtilization class, which refers to *both*
So because ServerUtilization has a FK relation to Server they cannot
have any columns with the same name?
On Tue, Dec 22, 2020 at 1:28 PM Mike Bayer wrote:
>
> this error means that your Server class has a column attribute which you
> would access as Server.updatedDate. Your ServerUtilization
this error means that your Server class has a column attribute which you would
access as Server.updatedDate. Your ServerUtilization subclass has another
column attribute which you would also access as ServerUtilization.updatedDate.
the problem arises in that ServerUtilization refers to the
I have these 2 models:
class Server(Base):
__tablename__ = 'Server'
serverName = Column(String(50, 'SQL_Latin1_General_CP1_CI_AS'),
primary_key=True)
serverTypeEnumID = Column(Integer)
serverComponentEnumID = Column(ForeignKey('Enumeration.enumID'))
serverEnvironmentEnumID =