0

I have a model class FlagTabel:

class FlagTable(Base):
    __tablename__ = "FLAG_TABLE"

    FLAG_TABLE_ID = Column(Integer, primary_key=True, autoincrement="auto")
    COLUMN_1 = Column(Boolean)
    COLUMN_2 = Column(Boolean)
    COLUMN_3 = Column(Boolean)

I have a function in FlagTable.py that would create a record with the FlagTable object:

from FlagTable import FlagTable

def addFlagsToFlagTable(arg1, arg2, arg3):
    myFlags = FlagTable(COLUMN_1=arg1, COLUMN_2=arg1, COLUMN_3=arg1)
    session.add(myFlags)
    session.commit()

#main code
callFunc = addFlagsToFlagTable(true, false, false)

When I step through the code in debugger mode I see that the record I want to add to my postgres database table gets added at the time of the import. It does not even wait for when the addFlagsToFlagTable function gets called in my main code. My 'Base = declarative_base()' statement is in another class which is related to FlagTable class.

rfkortekaas
  • 6,049
  • 2
  • 27
  • 34

0 Answers0