Thanks Dj Glicrease:
I see that the the admin interface works just as you said. Thats
pretty smart. However, I don't see the name of the related object, it
show something like...
Here's the model...
class TestModel2(models.Model):
m2mfield1 = models.ManyToManyField('TestModel1')
active
my_choices = [(bo.id, bo.name) for bo in Business.objects.all()]
business = models.ManyToManyField('Business', choices=my_choices)
But can I ask why you are trying to set the choices value on a
ManyToMany relationship? The admin will already automaticly only let
you select from the Business model
In one of my models, I have defined a field as follows:
business = models.ManyToManyField('Business',
choices=Business.objects.all())
How do i get the choices to be read from the Business model? I get the
following errors in the admin console...
Request Method: GET
Request URL:ht
3 matches
Mail list logo