Skip to content

Days 37-40: Intro to Pyramid: Adding the data models #33

Closed
@gloc-mike

Description

@gloc-mike

In this section of the course, I copied the bin, data and db code from the 100 Days GitHub repo into my version of the code.

I found that in data/db_session.py, the return value needs to be the attribute factory i.e. DbSession.factory, rather than the method i.e. DbSession.factory().

However, after fixing that issue, I am now confronted with another. In bin/load_base_data.py, the session returned does not have the 'query' attribute!

I created this Gist which shows the error:
https://gist.github.com/gloc-mike/ddb4fb4ca0aa1ba81209623a8858d606.

When I review the session object in the debug console in PyCharm, I can see that 'query' appears in the public_methods tuple (see attached screenshot) but the my watch expression again, shows the attribute error.

Screen Shot 2020-02-24 at 12 51 24

Any ideas to help me resolve this issue would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions