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 Gettin' CRUD-y With It CRUD: Create Function

Create a function named create_challenge() that takes name, language, and steps arguments. Steps should be optional,

Create a function named create_challenge() that takes name, language, and steps arguments. Steps should be optional, so give it a default value of 1. Create a Challenge from the arguments. create_challenge should not return anything. ... how is it missing arguments? please help =)

crud.py
from models import Challenge
def create_challenge(Challenge):
    name = CharField(max_length=100)
    language = CharField(max_length=100)
    steps = IntegerField(default=1)

8 Answers

maybe watch the video again? charField perhaps.. or char_field?

it specifically says what arguments it expects.. THREE name, language, and steps.. not sure why you are only giving one? :p

I am guessing this part is not clear enough for you ;)

Create a function named create_challenge() that takes name, language, and steps arguments.. You are giving ONE arguement which isnt event correct

As in ... def create_challenge(name): ... ? :)

now it says ... 'CharField' is not defined... after I entered....

from models import Challenge def create_challenge(name, language, steps): name = CharField(max_length=100) language = CharField(max_length=100) steps = IntegerField(default=1)

Its saying CharField is not defined bacause you forgot to import peewee

Which exact video? :)

the one where he shows how to create a class for database tables perhaps... Come on man, use some initiative here.. do google search.. don't wait for a reply here..