Here are the model definitions:
class ItemBrand(models.Model):
name = models.CharField(max_length = 30, unique = True)
def __unicode__(self):
return self.name
class WantedItem(models.Model):
name = models.CharField(max_length = 120)
description = models.TextField()
created = models.DateTimeField(auto_now = False, auto_now_add = True)
expires = models.DateTimeField(auto_now = False, auto_now_add = False)
type = models.ForeignKey(ItemType, related_name = "type wanted")
GENDER_CHOICES = (
(1, 'Male'),
(2, 'Female')
)
gender = models.IntegerField(choices = GENDER_CHOICES)
brands = models.ManyToManyField(ItemBrand, related_name = "wantedbrands", symmetrical = False)
colors = models.ManyToManyField(ItemColor)
sizes = models.ManyToManyField(ItemSize)
creator = models.ForeignKey(User, related_name = "wishlist creator")
def __unicode__(self):
return self.name
Here is the AdminModel code:
class BrandsInline(admin.TabularInline):
model = WantedItem.brands.through
class WantedItemAdmin(admin.ModelAdmin):
list_display = ('name', 'created', 'expires', 'type', 'gender', 'creator')
search_fields = ('name', 'description')
list_filter = ('created', 'brands',)
ordering = ('-created',)
inlines = [
BrandsInline,
]
exclude = ('brands',)
This is pulled basically right from the Django docs, and here's the error I am getting:
'ReverseManyRelatedObjectsDescriptor' object has no attribute 'through'
I am at a total loss... any ideas? Even if I literally create a linker table and set the "through" attribute in the Model I get the same error.
Broken?