I have a MusicAlbum which might have not just one genre related to it. Within my import process I have the following function defined to first get the genre and second, create a relation between the MusicAlbum and the Genre:
def pull_genre(object_id):
genre_list = []
split_content = [meta.strip() for meta in genre_value.split(',')]
genre_list.append(split_content)
for genre in genre_list:
new_genre, create = object_id.genre_relation.get_or_create(
name=genre,
object_id=object_id,
)
Problem now is that the following gets written to my Database:
['Rock', 'Metal']
But what I want is not a list stored inside my database, instead I want to have separate objects at my DB. One for Rock the other for Metal, what I'm doing wrong here?