havok2063 / boolean_parser

python package for parsing a string with boolean logic
https://boolean-parser.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
14 stars 7 forks source link

from database.models import TableModel error #2

Closed anisengupta closed 3 years ago

anisengupta commented 3 years ago

Hi, I am trying to use the boolean-parser module but I am having trouble with importing the relevant modules:

image

Do you know what this error might be?

Thanks, Aniruddha

havok2063 commented 3 years ago

@anisengupta Are you trying to copy and paste the examples from the documentation? Those are just toy examples and don't represent real code. Essentially wherever you see from database import session you should replace with your import of an instantiated SQLAlchemy database Session, and wherever you see from database.models import TableModel you should replace with your imports of your defined SQLAlchemy Models you want to use in the parser.

But you make a good point that perhaps I should update the documentation to clarify that it's a toy example, meant to be replaced by real code. I'll create a separate issue for that.