Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Using Databases in Python Meet Peewee Queries Are Your Friend

Shana HT
Shana HT
3,292 Points

what kind of variable is student_record?

I try to run this code exactly as it is in the lesson, on my own, in pycharm, and get this error

students.py", line 30, in add_students student_record.save() AttributeError: 'int' object has no attribute 'save'

2 Answers

Ryan S
Ryan S
27,275 Points

Hi Shana,

Can you post your code? It is difficult to debug without seeing it. If you were following along in the video chances are it's typo of some kind. You would've had to have defined "student_record" somewhere before calling it's .save() function. Maybe find that line and check for any typos.

Shana HT
Shana HT
3,292 Points

yes it was just a typo, sorry ... should have took more time on it

Ryan S
Ryan S
27,275 Points

Hey no worries. Glad you got it figured out.