Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJordan Featherstone
5,973 Points0 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 Burkett
3,642 PointsRobin Burkett
3,642 PointsI 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".