Clean up syntax formatting of queries
Committed 31229e
--- a/webint_posts/__init__.py
+++ b/webint_posts/__init__.py
resource = db.select(
"resources",
vals=[nickname],
- where="""json_extract(resources.resource,
- '$.nickname[0]') == ?""",
+ where="""json_extract(resources.resource, '$.nickname[0]') == ?""",
)[0]
return resource["resource"]
"""Return a list of entries."""
return db.select(
"resources",
- order=f"""json_extract(resources.resource,
- '$.published[0]') {modified}""",
- where="""json_extract(resources.resource,
- '$.type[0]') == 'entry'""",
+ order=f"""json_extract(resources.resource, '$.published[0]') {modified}""",
+ where="""json_extract(resources.resource, '$.type[0]') == 'entry'""",
limit=limit,
)
"""Return a list of alphabetical cards."""
return db.select(
"resources", # order="modified DESC",
- where="""json_extract(resources.resource,
- '$.type[0]') == 'card'""",
+ where="""json_extract(resources.resource, '$.type[0]') == 'card'""",
)
"""Return a list of alphabetical rooms."""
return db.select(
"resources", # order="modified DESC",
- where="""json_extract(resources.resource,
- '$.type[0]') == 'room'""",
+ where="""json_extract(resources.resource, '$.type[0]') == 'room'""",
)
def get_year(db, year):
return db.select(
"resources",
- order="""json_extract(resources.resource,
- '$.published[0].datetime') ASC""",
+ order="""json_extract(resources.resource, '$.published[0].datetime') ASC""",
where=f"""json_extract(resources.resource,
- '$.published[0].datetime')
- LIKE '{year}%'""",
+ '$.published[0].datetime') LIKE '{year}%'""",
)