Thanks Chris
It turned out I hadn't read the docs properly. Prior to posting the
problem I had tried ...
instance.item_pictogram_set.remove(pic)
... to be told the relatedmanager object didn't have a remove attribute
when (I thought) it should. So I adjusted the database to make both fk
fields nullable and deliberately made them None to get the code working.
But I should have stuck with nullable foreign keys and the above
instance.item_pictogram_set.remove(pic) because that was all that is
required.
I hadn't read beyond the example code in the docs [1] for the remove
method where it says ...
"In order to prevent database inconsistency, this method only exists on
ForeignKey objects where null=True. If the related field can't be set to
None (NULL), then an object can't be removed from a relation without
being added to another. In the above example, removing e from
b.entry_set() is equivalent to doing e.blog = None, and because the blog
ForeignKey doesn't have null=True, this is invalid."
[1]
https://docs.djangoproject.com/en/dev/ref/models/relations/#django.db.models.fields.related.RelatedManager.remove
Mike
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/django-users/-/TjN8sz1YkQwJ.
> To post to this group, send email to
django...@googlegroups.com.
> To unsubscribe from this group, send email to
>
django-users...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/django-users?hl=en.