I'm attempting to use a similar Category implementation to this one in the Django Wiki. I'm wondering what the Django way of doing a search to pull all objects associated with a parent category. For example, if I have a category "TV" and it has subcategories "LED", "LCD", and "Plasma", how would I be able to easily query for all TV's without recursively going through all subcategories and subsubcategories (if there are any).
Code wise I was thinking something like:
class Item(models.Model):
name = ...
...
category = models.ForeignKey(Category, null=True, blank=True)
so with this type of implementation is there any easy way to do what I need, or is there any other better solution?
Thank you!