Skip to content

Instantly share code, notes, and snippets.

@silenius
Created June 18, 2021 08:02
Show Gist options
  • Save silenius/2054e7dc690946c0122c72e6b05f1433 to your computer and use it in GitHub Desktop.
Save silenius/2054e7dc690946c0122c72e6b05f1433 to your computer and use it in GitHub Desktop.
>>> foo = sql.and_(Content.title=='123', Content.owner_id==3)
>>> foo
<sqlalchemy.sql.elements.BooleanClauseList object at 0x80635f850>
>>> print(foo)
anon_1.amnesia_multilingual_content_translation_title = :amnesia_multilingual_content_translation_title_1 AND content.owner_id = :owner_id_1
>>> foo.append(Content.container_id == 2)
Traceback (most recent call last):
File "/usr/home/julien/code/venvs/riparias/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 826, in __getattr__
return getattr(self.comparator, key)
AttributeError: 'Comparator' object has no attribute '_text_converter_role'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/home/julien/code/venvs/riparias/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 2302, in append
coercions.expect(self._text_converter_role, clause).self_group(
File "/usr/home/julien/code/venvs/riparias/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 837, in __getattr__
replace_context=err,
File "/usr/home/julien/code/venvs/riparias/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 207, in raise_
raise exception
AttributeError: Neither 'BooleanClauseList' object nor 'Comparator' object has an attribute '_text_converter_role'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment