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 trial

Python Using Databases in Python Meet Peewee Create Table

How do I do this question?

Help!

tables.py
from peewee import *

db = SqliteDatabase('challenges.db')

class clanghe

1 Answer

Stephen Bone
Stephen Bone
12,359 Points

Hi Kevin

So it looks like you've completed the first two challenge tasks and must be stuck on the third?

You need to create a class called Challenge and pass in the Model class so it inherits from it. You then need to give it two fields of the specified type and length.

So your code should look something like below:

class Challenge(Model):
  name = CharField(max_length=100)
  language = CharField(max_length=100)

Hope it helps!

Stephen

Thanks you very much:) I got it.