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

Bapi Roy
Bapi Roy
14,237 Points

How to add a default value to inheritance model field?

I have two model class in django project

class A(models.Model):
         prefix = models.CharField(max_length=20)
         full_name = models.CharField(max_length=100)

class B(A):
         place = models.CharField(max_length=100)

My question is how do I set the default value of prefix in class B?