Import action multiple models
Hi, I am working with an importer class. My use case is that one csv is converted to multiple models.
For example one row contains a card number. I first want to insert the card to retrieve a card_id.
I have the following models which need to be inserted based on this csv:
I am currently trying this approach, but was wondering if I am doing it wrong:
For example one row contains a card number. I first want to insert the card to retrieve a card_id.
I have the following models which need to be inserted based on this csv:
- cards
- cars
- stations
- countries
- and the main one which are rows, containing foreign keys to all the above.
I am currently trying this approach, but was wondering if I am doing it wrong: