text: Jordan Featherstone5,973 Points
  0 Results on .tables
  I'm not sure why, but the tables don't seem to be saving in the database, i have scanned through my code and couldn't notice any errors. So i'm guessing its something very small that i cant put my finger on.
  from peewee import * import datetime db = SqliteDatabase('dairy.db') class Entry(Model): content = TextField() timestamp = DateTimeField(default=datetime.datetime.now) class Meta: database = db def init(): db.connect() db.create_tables([Entry], safe=True) def menu_loop(): """ loop """ def add_entry(): """add""" def view_entries(): """View pervious entries.""" def delete_entry(entry): """Delete an entry.""" if __name__ == '__main__': init() menu_loop()
  Robin Burkett3,642 Points
  Robin Burkett3,642 Points
  I noticed 2 typos, but they probably aren't the problem.
  What solved my problem when this happened to me was using the command "sqlite3 diary.db" to start sqlite3 instead of just "sqlite3".