Giter Site home page Giter Site logo

Comments (5)

gloc-mike avatar gloc-mike commented on July 18, 2024

My assumption is wrong i.e. that DbSession.factory()needed to be refactored to DbSession.factory. so I'm closing this issue.

My code works after reverting to DbSession.factory() but it is still very odd that it did not run when I first copied the data modelling modules into my project. Is there maybe a first run issue?

I'm still at a loss as to why my version was not working. When I was debugging it I could clearly see that the DbSession.factory attribute was set to None which is why it was originally failing but why should it suddenly start working after I revert my change above?

Anyway, I am closing this issue.

from 100daysofweb-with-python-course.

mikeckennedy avatar mikeckennedy commented on July 18, 2024

Hi @gloc-mike It definitely needs to be returning a Session. But I think the problem was it's returning session_maker not session_maker(). One is the function that makes sessions, the other is a particular session created by that function for the Unit of Work.

Hope that helps!
Michael

from 100daysofweb-with-python-course.

gloc-mike avatar gloc-mike commented on July 18, 2024

Hi,

I created a new Pyramid project with which I want to build to track timesheet info and I am getting the original error (the error that occurred BEFORE the error I originally reported in this issue).

Please see the Gist I created for this error:
https://gist.github.com/gloc-mike/fd84826f0c505be1e61f7f7493925bd0

I created the timesheet project using PyCharm using the Pyramid project template (not the from the commandline using the cookiecutter template). The PyCharm template for Pyramid comes with a lot of jinja2 code (even though I specified chameleon as the template language) so I removed the jinja2 code, then I added the bits and pieces from the course i.e. the bin, data and db folders and code, and I modified the data model etc. to suite the this project.

After making all of the necessary changes needed, I ran it and it failed when the DbSession.factory() call returned a 'None' value. This error also occurred when I built the bill_tracker version of the project.

Here is the link to the timesheets project on GitHub:
https://github.com/gloc-mike/timesheets

Thanks for the help!
Michael

from 100daysofweb-with-python-course.

mikeckennedy avatar mikeckennedy commented on July 18, 2024

Hi, I responded to the issue in the gist.

from 100daysofweb-with-python-course.

mikeckennedy avatar mikeckennedy commented on July 18, 2024

Hi @gloc-mike There were quite a few issues with the repo. Here's a running version. Try doing a diff on the directories to see what changed. :)

https://send.firefox.com/download/406ddab5c4cabb0c/#iau8zBEX6mH9Bwbd5QOnxQ

from 100daysofweb-with-python-course.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.