D
D
Dizzy Qucile2020-11-05 16:09:01
Django
Dizzy Qucile, 2020-11-05 16:09:01

How to select multiple performers in a field?

How to select multiple artists from the list? Now there is only one performer.
5fa3f8f6c59f7967296732.png

Here is the models.py code:

spoiler
from django.db import models


class Executor(models.Model):
    name = models.CharField(max_length=32, null=True)

    def __str__(self):
        return self.name


class Task(models.Model):
    name = models.CharField(max_length=100, null=True)
    executor = models.ForeignKey(Executor, on_delete=models.CASCADE)

    def __str__(self):
        return self.name


class Project(models.Model):
    name = models.CharField(max_length=32, null=True)
    tasks = models.ForeignKey(Task, on_delete=models.CASCADE)

    def __str__(self):
        return self.name

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-11-05
@DiZiNnEs

https://docs.djangoproject.com/en/3.1/ref/models/f...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question