ticket 5929

116 views
Skip to first unread message

Barhamou Hama

unread,
Jan 8, 2023, 11:15:35 AM1/8/23
to Django developers (Contributions to Django itself)
Hi all, I came across this ticket here opened 15 years ago that doesn't seem to have been resolved. I decided to work on it. But in 15 years a lot can happen. Is it still relevant? Has there been any progress on this issue?

Curtis Maloney

unread,
Jan 8, 2023, 6:16:56 PM1/8/23
to 'Mike Hansen' via Django developers (Contributions to Django itself)
On Sun, 8 Jan 2023, at 23:29, Barhamou Hama wrote:
Hi all, I came across this ticket here opened 15 years ago that doesn't seem to have been resolved. I decided to work on it. But in 15 years a lot can happen. Is it still relevant? Has there been any progress on this issue?
 

IIRC there's no current support for this, the closest being GenericForeignKeys, which still require their sub-fields defined separately.

There has been posts about supporting joint using multi-field keys (https://devblog.kogan.com/blog/custom-relationships-in-django) however, that's a rather specific case.

I think it would be a good thing for progress on this issue to happen.

You might also want to check the ticket history for any work on multi-value keys.

--
Curtis


Adrian Torres

unread,
Jan 9, 2023, 6:57:31 AM1/9/23
to Django developers (Contributions to Django itself)
I feel like this is a very niche use case and probably doesn't warrant implementing field-to-column one-to-many relationships in Django, I don't see why this specific case can't be implemented as:

1. A model that implements the data type
2. A custom field + custom datatype on the database backend
3. ArrayField [1] if using postgres

Barhamou Hama

unread,
Jan 9, 2023, 9:56:13 AM1/9/23
to Django developers (Contributions to Django itself)

Thanks, I will study the question to find out more.

Barhamou Hama

unread,
Jan 9, 2023, 9:59:45 AM1/9/23
to Django developers (Contributions to Django itself)
Hence the interest of my question, if in 15 years it has not been solved, there must be a reason.

Tobias McNulty

unread,
Jan 10, 2023, 9:23:35 AM1/10/23
to django-d...@googlegroups.com
Thank you Barhamou for raising the question here and starting the discussion.

I agree with Adrian that this feels like a pretty niche use case.  Depending on the needs, other possible implementations might include:

4. A form field mapping to multiple model fields
5. A custom queryset/manager that takes "shorthand filter queries" and expands them to multiple model fields

As for the example in #5929 ticket description, that is probably best solved with #2 on Adrian's list, for example the django-netfields project for Postgres.

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/9e4ee8c9-aa22-4ac1-bd70-1c87427ca955n%40googlegroups.com.

Barhamou Hama

unread,
Jan 10, 2023, 6:34:10 PM1/10/23
to Django developers (Contributions to Django itself)
Hi, I'm glad I contributed to something. I understand your point of view. I'm new and looking for an interesting topic to work on in my spare time.
I don't want to waste my energy on a feature that doesn't get a lot of support.
However, if this ticket still exists, there must be a problem somewhere.
Reply all
Reply to author
Forward
0 new messages