Hi,

I tried to stack two models in the admin interface. Any ideas why I
get this error?

issubclass() arg 1 must be a class
File "C:\Django\myproject\myapp\admin.py" in <module>
  22. admin.site.register(Manufacturer, ManufacturerAdmin)

admin.py
------------------------------------------------
class AeroplaneInline(admin.TabularInline):
    model = Aeroplane
    extra = 3

class ManufacturerAdmin(admin.ModelAdmin):
    list_display = ('name', 'country', 'aeroplane.name')
    inlines = ('AeroplaneInline',)

admin.site.register(Manufacturer, ManufacturerAdmin) # This is line 22
------------------------------------------------


models.py
------------------------------------------------
class Manufacturer(models.Model):
    country = models.ForeignKey(Country)
    name    = models.CharField(max_length=32, unique=True)

class Aeroplane(models.Model):
    manufacturer = models.ForeignKey(Manufacturer)
    name            = models.CharField(max_length=32, unique=True)
------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to