I have a basket object, each basket could have many balls and a ball could be on many baskets, moreover each ball has many colors but one color is for one ball only. Models example:
class Basket(models.Model):
name = models.CharField(max_length = 100)
class Ball(models.Model):
basket = models.ManyToManyField(Basket, )
class Color(models.Model):
ball = models.ForeignKey(Ball, on_delete = models.CASCADE)
Each object has many other fields, not relevant
I want in admin site when create a basket, select which ball and which color per ball. I tried inline, but it adds a new ball, i want just select existing ball and related color.
PS:IMHO This is not a duplicate of this question because select Basket is covered but not select Color per ball.
Thanks all
Update
My app is an excercise, i want to create a basket with undefined number of balls and choose which color has any of the ball from a list of color assigned to that ball.
You could call also basket as object1, ball as object2 and color as object3, it doesn't matter.
All should be using admin site.
That's my goal.