My current setup is a parent class:
{{{
# app "vulns"
class Finding(models.Model):
...
related_to = models.ManyToManyField('self', blank=True,
help_text='Other findings related to this one')
}}}
And then child class (adding for completeness but not sure it matters)
{{{
# app "burp"
class Finding(vuln_models.Finding):
...
}}}
`vulns.Finding` has an admin model defined with search fields `id` and
`title`
When editing a burp.Finding (changeform) the autocomplete for `related_to`
sends `related_to_rel+` as `field_name` resulting `self.source_field`
being set to the `ManyToManyRel` (not the `ManyToManyField`).
The Rel has `limit_choices_to` but it does not have a
`get_limit_choices_to` (while the Field does).
I've been trying to find if it's me doing something wrong in the model
definition but it's pretty straightforward...
--
Ticket URL: <https://code.djangoproject.com/ticket/33489>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => needsinfo
* component: Uncategorized => contrib.admin
* type: Uncategorized => Bug
Comment:
Thanks for the report, however I cannot reproduce this issue with
described models. Can you provide a small sample project?
--
Ticket URL: <https://code.djangoproject.com/ticket/33489#comment:1>
Comment (by Filipe):
So I've pushed a sample app but was also unable to reproduce. I'll try to
find the quirks in the original code and I'll update the ticket (if it's
not something in the project code/setup)
--
Ticket URL: <https://code.djangoproject.com/ticket/33489#comment:2>
Comment (by Filipe):
ok, found the culprit line and it was not even in the custom theme, it was
directly in the project code...
Should've started a sample app from the start and would've saved some
bytes and bandwidth on this ticket :)
cheers
--
Ticket URL: <https://code.djangoproject.com/ticket/33489#comment:3>
* resolution: needsinfo => invalid
Comment:
Thanks for checking.
--
Ticket URL: <https://code.djangoproject.com/ticket/33489#comment:4>