I tried the to_field argument, that was a mistake, and I put it back.
I was just inserting the pk of the foreign object. However, as things are moving through the pipeline, I used uuid.uuid4() to create additional pks as needed at it went along.
Example:
def process_item(self, item, spiders):
itemcasebycase['case_arrow'] = item['uniqid']
itemcasebycase['uniqid'] = get_u
But this is what works in the pipeline:
scotus = Jurisdiction.objects.get(
uniqid='5e4dd0c2-5cc9-4d08-ab43-fcf0e84dfc44')
item['jurisdiction'] = scotus
And this is the error message I got:
ValueError: Cannot assign "UUID('5e4dd0c2-5cc9-4d08-ab43-fcf0e84dfc44')": "Case.jurisdiction" must be a "Jurisdiction" instance
Finally, yes, under normal circumstances, my pk uuids are made automatically. Thanks