Skip to content

Commit

Permalink
Change some Query.get() into Session.get() calls
Browse files Browse the repository at this point in the history
See #310 — sqlalchemy-2.0 migration
  • Loading branch information
sde1000 committed Jan 18, 2025
1 parent d6ea78b commit 3e7d00e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions quicktill/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def preload(cls):
ci._read()

def _read(self):
d = td.s.query(Config).get(self.key)
d = td.s.get(Config, self.key)
if d is None:
# The config option doesn't exist in the database. Initialise it
# with the default.
Expand Down Expand Up @@ -257,7 +257,7 @@ def run(args):
for ci in td.s.query(Config).order_by(Config.key).all():
print(f"{ci.key}: {ci.display_name}: {ci.value}")
return
ci = td.s.query(Config).get(args.key)
ci = td.s.get(Config, args.key)
if not ci:
print(f"Config key {args.key} does not exist")
return 1
Expand Down
4 changes: 2 additions & 2 deletions quicktill/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ def name(self):
@property
def keycap(self):
from . import td, models
cap = td.s.query(models.KeyCap).get(self.name)
cap = td.s.get(models.KeyCap, self.name)
if cap:
return cap.keycap
return ""

@property
def css_class(self):
from . import td, models
cap = td.s.query(models.KeyCap).get(self.name)
cap = td.s.get(models.KeyCap, self.name)
if cap:
return cap.css_class

Expand Down

0 comments on commit 3e7d00e

Please sign in to comment.