Hello all,

Up to now, (admittedly not long - I'm not a total newbie but I still have a 
LOT to learn) when making a foreign key I would just put the pk of that 
instance in the fk field, as the docs suggest:

By default ForeignKey will target the pk of the remote model but this behavior 
can be changed by using the ``to_field`` argument.

*https://docs.djangoproject.com/en/2.0/_modules/django/db/models/fields/related/#ForeignKey
 
*

However, recently while working with a scrapy pipeline, these fields 
started catching errors, which told me

"...must be an instance of ...(foreign object)"

And sure enough, if I did a get queryset for the one specific instance in 
question, that worked. My question is why, or maybe it should be, what's 
the difference, or maybe even, what's going on here, or wtf?

Any light you can shed on this for me would, as always, be greatly 
appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5f9399d4-6a48-450a-b2bd-2e33a296b1b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to