> class Product(models.Model):
>         snip...
>
> class Word(models.Model):
>         value =  models.CharField(maxlength=200, core=True, unique=True)
>
> class  ProductWord(models.Model):
>         fk_word = models.ForeignKey(Word, core=True)
>         fk_product = models.ForeignKey(Product)
>
>
> and it should be so simple...
>
>  >>> p  = ProductWord.objects.filter(word__value='haddock')
>  >>>TypeError: Cannot resolve keyword 'word' into field
Your ProductWord has a field "fk_word", but not "word", so you should write:
p  = ProductWord.objects.filter(fk_word__value='haddock')

And yes, it is many-to-many relationship between Product and Word.

Regards,
Aidas Bendoraitis [aka Archatas]

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to