fix dla mysql
This commit is contained in:
6
app.py
6
app.py
@@ -951,9 +951,11 @@ def save_pdf_as_webp(file, path):
|
||||
|
||||
|
||||
def get_active_months_query(visible_lists_query=None):
|
||||
if db.engine.name == "sqlite":
|
||||
if db.engine.name in ("sqlite",):
|
||||
month_col = func.strftime("%Y-%m", ShoppingList.created_at)
|
||||
else:
|
||||
elif db.engine.name in ("mysql", "mariadb"):
|
||||
month_col = func.date_format(ShoppingList.created_at, "%Y-%m")
|
||||
else: # PostgreSQL i inne wspierające to_char
|
||||
month_col = func.to_char(ShoppingList.created_at, "YYYY-MM")
|
||||
|
||||
query = db.session.query(month_col.label("month"))
|
||||
|
Reference in New Issue
Block a user