문제

I'm using elixir/flask in a small web app I wrote for my own personal aggregator.

I'm trying to create a restful call to mark all items of a particular rssfeed as read.

The SQL statement would look something like UPDATE model_rssitems set hasbeenseen = 1 where rssfeed_id = '%s' % feedid

I don't know how to write the code to make elixir perform that action and when I tried to use session.execute I get an error saying UnboundExecutionError: Could not locate a bind configured on SQL expression or this Session

I'm sure I'm doing something wrong but I can't figure out what.

도움이 되었습니까?

해결책

I assume you haven't used the bind expression yet :)

Your code requires something like this to tell Elixir what database you're using.

from elixir import metadata
metadata.bind = 'sqlite:///your_database_file.sqlite'
metadata.bind.echo = True
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top