Skip to content

Importing a ManyToManyField with an intermediary model (using "through" argument) using the ManyToManyWidget #1335

Closed Answered by pokken-magic
shubhankar5 asked this question in Q&A
Discussion options

You must be logged in to vote

I was doing some thought on this and I don't think there is a way to do this because through models would need to exist already. The overall way import export works is that it does not create any models except the primary model, so relations need to already exist in the target system (including through models).

I have done a lot of work for work with serializing relationships and creating them, so I can give you some feedback that it is very possible to serialize additional models.

The two approaches I have explored are:

  1. Creating a widget that can serialize a list of fields from a model (This works well for InLines and Through models)
  2. creating a widget that can serialize an entire model …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@shubhankar5
Comment options

@pokken-magic
Comment options

Answer selected by pokken-magic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants