I have a Model class:
class PlatformUsage(db.Model):
__tablename__ = 'platform_usage'
id = db.Column(db.BigInteger, primary_key=True)
module = db.Column(db.String(64))
rb = db.Column(db.BigInteger)
status = db.Column(db.String(64))
platform = db.Column(db.String(64))
def __init__(self, module, rb, status, platform):
self.module = module
self.rb = rb
self.status = status
self.platform = platform
def __repr__(self):
return "<PlatformUsage(module: %s, rb: %d, status: %s, platform: %s>" % (
self.module, self.rb, self.status, self.platform)
when i query like this:
while True:
PlatformUsage.query.filter_by(module='xxx')
I change the db externally, I can not get the newest results! why ?
session.query(PlatformUsage).filter_by(xxxx)
will get the correct result!