I haven't followed your code in detail, but I think the problem might be here:
clazz = school.Class('12', 'A') students = [ Student("Name1", "Sname1", clazz=clazz, code='aa7'), Student("Name2", "Sname2", clazz=clazz, code='bb7'), Student("Name3", "Sname3", clazz=clazz, code='cc7') ] You are creating an instance of "school.Class", which is the non-sqlalchemy base class. You probably meant to create an instance of "Class", which is the SQLAlchemy-mapped subclass, didn't you? Simon On Fri, Mar 12, 2021 at 11:10 AM ScottBot <sfaurh...@gmail.com> wrote: > > I have a game that I am coding for school (not a project or homework) and I > am trying to use a SQLite database with sqlalchemy to store the game info. I > don't know what the problem is or how I can fix it. Any help is appreciated. > https://stackoverflow.com/questions/66591466/sqlalchemy-orm-from-regular-class > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/b3e6fb67-6cab-4484-8c39-a01999640e67n%40googlegroups.com. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/CAFHwexcFYWK7yu9hW42LgUDB3LL%2BFAuCJqogpvYDjBe1MHigNQ%40mail.gmail.com.