diff options
Diffstat (limited to 'gnu/packages/patches/gourmet-sqlalchemy-compat.patch')
-rw-r--r-- | gnu/packages/patches/gourmet-sqlalchemy-compat.patch | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gnu/packages/patches/gourmet-sqlalchemy-compat.patch b/gnu/packages/patches/gourmet-sqlalchemy-compat.patch new file mode 100644 index 0000000000..d0cdf9e5a7 --- /dev/null +++ b/gnu/packages/patches/gourmet-sqlalchemy-compat.patch @@ -0,0 +1,18 @@ +diff --git a/gourmet/backends/db.py b/gourmet/backends/db.py +index faa6a57a..7e6d2bc6 100644 +--- a/gourmet/backends/db.py ++++ b/gourmet/backends/db.py +@@ -773,9 +773,11 @@ class RecData (Pluggable): + """Return the number of rows in table that match criteria + """ + if criteria: +- return table.count(*make_simple_select_arg(criteria,table)).execute().fetchone()[0] ++ return sqlalchemy.select( ++ sqlalchemy.func.count(criteria)).select_from(table).scalar() + else: +- return table.count().execute().fetchone()[0] ++ return sqlalchemy.select( ++ sqlalchemy.func.count()).select_from(table).scalar() + + def fetch_join (self, table1, table2, col1, col2, + column_names=None, sort_by=[], **criteria): |