Nice solution. Thanks!
On Thursday, June 25, 2020 at 5:49:23 PM UTC-4, Dan Madere wrote:
>
> I don't know of a way to configure the admin do that, but one solution
> would be to use signals to notice when one-way records are created, then
> automatically create the record for reverse relationshi
I don't know of a way to configure the admin do that, but one solution
would be to use signals to notice when one-way records are created, then
automatically create the record for reverse relationship. We need to notice
when records are deleted as well. This approach would allow showing one
inl
After reviewing the tests, I think I now understand what is going on.
Basically, for symmetric ManyToManyField, Django creates entries for both
directions automatically if the correct interface is used. From the test
models:
class PersonSelfRefM2M(models.Model):
name = models.CharField(max_
On Thursday, June 25, 2020 at 10:26:25 AM UTC-4, Dan Madere wrote:
>
> I tried out the example code, and can replicate this. What's interesting
> is that if I try removing the ContactConnection model, and the "through"
> attribute, this allows Django to create the intermediate table on its own,
I tried out the example code, and can replicate this. What's interesting is
that if I try removing the ContactConnection model, and the "through"
attribute, this allows Django to create the intermediate table on its own,
and then your get_connections() method works as expected! It seems like
us
Mike, Thanks for your suggestions.
Just a stab in the dark - have you tried giving from_contact a
> related_name?
>
Yes, I have tried a few different combinations of providing a single
related_name and various naming conventions when providing related_name on
both ForeignKey fields without s
On 25/06/2020 8:29 am, Jim Shepherd wrote:
I am unable to get a symmetrical, self-referencing ManyToManyField
with a through table to actually be symmetrical, at least through the
Admin interface. I am using Django 3.0 so it looks like the capability
is supported.
Models:
class Contact(models
I am unable to get a symmetrical, self-referencing ManyToManyField with a
through table to actually be symmetrical, at least through the Admin
interface. I am using Django 3.0 so it looks like the capability is
supported.
Models:
class Contact(models.Model):
last_name = models.TextField(d
8 matches
Mail list logo