In James Bennett's "Practical django Projects" (2nd edition) the author builds a content management system, leveraging off of django.contrib.admin. The problem is that it doesn't work.
I'm in chapter three, where he adds a keyword search capability, by adding a new admin module. The problem is is that I can't get it to work. Browsing around the web, I find constant complaints that despite the claims in the book, the author has not made working source available. The core of the problem is that he seems to be depending upon internals of the django platform that are changing with every minor release, hence his solutions prove fragile.
Still, I'd like to work my way through this.
In chapter three, he supposedly adds a new search keyword admin function, by creating a new SearchKeyword model, and then creating and registering a SearchKeywordAdmin class.
The model (in cms/search/models.py:
class SearchKeyword(models.Model):
keyword = models.CharField(max_length=50)
page = models.ForeignKey(FlatPage)
def __unicode__(self):
return self.keyword
The class (in cms/search/admin.py):
class SearchKeywordAdmin(admin.ModelAdmin):
pass
admin.site.register(SearchKeyword, SearchKeywordAdmin)
I see no compile errors, but I see nothing on the admin page.
Either I'm doing something wrong, or something in django.contrib.admin has changed, to make this code no longer work.
Anyone have any ideas which? And what I might need to do to make this work?