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.
Pachal DebbarmaCourses Plus Student 3,597 Points
Abstract inheritance issues with migrating the models.
class Step(models.Model): title = models.CharField(max_length = 255) description = models.TextField() order = models.IntegerField(default = 0) course = models.ForeignKey(Course) class meta: abstract = True ordering = ['order',] def __str__(self): return self.title class Text(Step): content= models.TextField(blank=True,default ='')
from django.contrib import admin from .models import Course,Step # Register your models here. class StepInline(admin.StackedInline): model = Step class CourseAdmin(admin.ModelAdmin): # inlines = [StepInline,] pass admin.site.register(Course,CourseAdmin) #admin.site.register(Step)
Even after following the instructions when i migrate the models i get the following error in terminal (django.core.exceptions.FieldError: Local field 'content' in class 'Text' clashes with field of the same name from base c)
Can anybody suggest me what that even mean?Please i need help