I'm trying to add some model fields to another model for admin editing
and can't seem to get it to work i.e., model doesn't show up in admin,
inline or otherwise.
project/app/admin.py
from project.app.models import SearchKeyword
from django.contrib.flatpages.models import FlatPage
from django.contrib import admin
from django.contrib.contenttypes import generic
class KeywordInline(generic.GenericStackedInline):
model = SearchKeyword
class PageAdmin(admin.ModelAdmin):
inlines = [
KeywordInline,
]
admin.site.register(PageAdmin)
project/app/models.py
from django.db import models
from django.contrib import admin
from django.contrib.flatpages.models import FlatPage
class SearchKeyword(models.Model):
keyword = models.CharField(max_length=50)
page = models.ForeignKey(FlatPage)
def __unicode__(self):
return self.keyword
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---