In my model I have:
class Poll(models.Model):
topic = models.CharField(max_length=200)
tags = models.ManyToManyField(Tag)
I’m trying to create the Poll object and store tags like so:
Tags = []
for splitTag in splitTags:
tag = Tag(name = splitTag.lower())
tag.save()
Tags.append(tag)
How do I set the Tags array and assign it to tags?
I have tried:
poll = Poll(topic=topic, tags = Tags)
poll.save()
Well, it should be more like this: