Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: unhashable type: 'dict' #8

Open
Pymancer opened this issue Oct 27, 2019 · 2 comments
Open

TypeError: unhashable type: 'dict' #8

Pymancer opened this issue Oct 27, 2019 · 2 comments

Comments

@Pymancer
Copy link

Error in docker-compose up console log:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask_unchained/cli.py", line 56, in cli_create_app
    return AppFactory.create_app(env)
  File "/usr/local/lib/python3.6/site-packages/flask_unchained/app_factory.py", line 75, in create_app
    unchained.init_app(app, env, bundles, _config_overrides=_config_overrides)
  File "/usr/local/lib/python3.6/site-packages/flask_unchained/unchained.py", line 109, in init_app
    run_hooks_hook.run_hook(app, bundles, _config_overrides=_config_overrides)
  File "/usr/local/lib/python3.6/site-packages/flask_unchained/hooks/run_hooks_hook.py", line 33, in run_hook
    hook.run_hook(app, bundles)
  File "/usr/local/lib/python3.6/site-packages/flask_unchained/app_factory_hook.py", line 98, in run_hook
    self.process_objects(app, self.collect_from_bundles(bundles))
  File "/usr/local/lib/python3.6/site-packages/flask_unchained/bundles/sqlalchemy/hooks/register_models_hook.py", line 27, in process_objects
    self.bundle.models = UnchainedModelRegistry().finalize_mappings()
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy_unchained/model_registry.py", line 73, in finalize_mappings
    if self.should_initialize(self._models[name]):
  File "/usr/local/lib/python3.6/site-packages/flask_unchained/bundles/sqlalchemy/model_registry.py", line 43, in should_initialize
    if model_name in self._initialized:
TypeError: unhashable type: 'dict'
@briancappello
Copy link
Owner

Hey, sorry you ran into this! The master branch of this repo is in a bit of a weird state at the moment, because it's targeting the master branch of Flask Unchained. Strangely I couldn't get the docker files to work when I tried to install Flask Unchained from master there. I'm working on getting the next version of Flask Unchained released, but I still have some work to do, mainly on the docs. In the meantime, you can checkout commit hash c0b94f3b608d95a349c6fe9b7a99a40c89da42c9 of this repo and that should work:

git checkout c0b94f3b608d95a349c6fe9b7a99a40c89da42c9

I also had to configure the timezone in docker/backend/Dockerfile:

-RUN apk add --no-cache linux-headers make gcc musl-dev libxml2-dev libxslt-dev libffi-dev postgresql postgresql-dev
+RUN apk add --no-cache linux-headers make gcc musl-dev libxml2-dev libxslt-dev libffi-dev postgresql postgresql-dev tzdata
+RUN cp /usr/share/zoneinfo/UTC /etc/localtime
+RUN echo "UTC" > /etc/timezone

@Pymancer
Copy link
Author

I'm working on getting the next version of Flask Unchained released

I'll wait, thx)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants