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 trialArcee Palabrica
8,100 PointsMy steps are not showing
I think I've followed what Kenneth has done. I've already added the steps in my admin but the StepInline doesn't seem to work... here are my codes:
from django.db import models
# Create your models here.
class Course(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=255)
description = models.TextField()
def __str__(self):
return self.title
class Step(models.Model):
title = models.CharField(max_length=255)
description = models.TextField()
order = models.IntegerField(default=0)
course = models.ForeignKey(Course)
def __str__(self):
return self.title
from django.contrib import admin
from .models import Course, Step
class StepInline(admin.StackedInline):
model = Step
class CourseAdmin(admin.ModelAdmin):
inslines = [StepInline,]
# Register your models here.
admin.site.register(Course, CourseAdmin)
admin.site.register(Step)
I'm also sure I've added the steps
But when I look at python basics in Course the step/s isn't shown
Am I missing something?
2 Answers
Ryan S
27,276 PointsHi Arcee,
It looks like you have a typo in CourseAdmin
. You have "inslines" instead of "inlines".
Rhisiart ap Gwilym
1,494 PointsIf you edit your code within an editor such as Visual Code with the Python plugin, you can hit auto-complete to enter the inherited property name
Arcee Palabrica
8,100 PointsArcee Palabrica
8,100 PointsOh Thanks Ryan wow those small typos really are... :D It worked! thanks so much