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 Django Basics Final Details Content Field

Sahar Nasiri
Sahar Nasiri
7,454 Points

Description and Content

If it is impossible to build a null TextField attribute, how did we build that description empty before?

3 Answers

JOHN WONG
JOHN WONG
556 Points

So wouldn't it be better off we now offer the same constraints on the description field?

I believe that the TextField is nullable, in other words it is possible for it to hold a null value by default.

Sahar Nasiri
Sahar Nasiri
7,454 Points

No, Kenneth just said that it is impossible to build a null TextField when he was defining the content variable, but just above the content, there is description variable which is null!

Pavel Raav
Pavel Raav
7,811 Points

As Kenneth explained, you can build a null TextField for the model when you don't have any existing rows in the database.