Where am i goofing in the following lookup?
My models:
Class Item(models.Model):
item_code = models.CharField(max_length=10)
name = models.CharField(max_length=255)
....
Class Stock(models.Model):
item_code = models.ForeignKey( Item )
qty = models.IntegerField()
...
Now i want to get all Stock objects with Item.item_code
stock_items = Stock.objects.filter(item__item_code__contains='101')
I get the error:
FieldError: Cannot resolve keyword 'item' into field. Choices are: id, item_code, qty, restock_level, userid
What am i missing?
Gath