I am working through the examples in a Django book that I have, but the book was written for 0.96 and I am using 1.0.2, yeah, I know, not the best idea. But reading Django’s ‘porting your apps from 0.96 to 1.0’ doc has cleared up most of the differences for me. Until I get to the point where I need to implement inline editing of a second model on the admin page.
I am using a custom keyword search model to allow you to search pages made using Django’s Flatpages app. Below is the model:
class SearchKeyword(models.Model):
keyword = models.CharField(max_length=50, blank=True) page = models.ForeignKey(FlatPage) def __unicode__(self): return self.keyword
What should my admin.py look like to set up a StackedInline for SearchKeyword that shows up on the Flatpages admin page?
You can do something like this:
More info in the official Django docs
Update: Fixed the code to suit your requirements.