sortowanie_w_mass_add #10

Merged
gru merged 90 commits from sortowanie_w_mass_add into master 2025-09-02 17:08:55 +02:00
Showing only changes of commit 25d1967fd8 - Show all commits

6
app.py
View File

@@ -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"))