GSoC 2024 proposal: Django ORM support for composite primary keys

@csirmazbendeguz my understand might be flawed but that’s way I see the current problem space

  1. CompositeField ought to provide a way to break the 1:1 assumption that the ORM currently has wrt/ to fields and database columns.
  2. Composite primary keys and foreign keys are the most common use cases for composite fields. We lack support for the first and the second can be achieved using existing interfaces and today without too much trouble so it’s more of a matter of exposing the proper interface for them.
  3. While composite primary keys could be implemented using a generic CompositeField primitive, assuming it already existed, it doesn’t necessarily have to and your proposal seems to agree with this premise.
  4. The fact that composite primary keys could land without using a generic CompositeField primitive at first is not a problem to me. It doesn’t negate the need for a generic CompositeField and allows the lessons learned from composite primary keys + GenericForeignKey to draft a more cohesive interface for the former.
1 Like

Actually, I’ve started looking into it, CompositeField or a similar virtual field does make sense instead of littering the Django internals code with isinstance(, tuple) checks.

1 Like

I’ve started working on my own PR.
Unfortunately, I don’t think I’m going to be able to participate in GSoC as I haven’t received a confirmation here, so I can’t make a commitment, but I’ll still give this feature a try.
@Lily-Foote, don’t let this discourage you from working on your PR.

@csirmazbendeguz GSoC works in that folks have to apply, and the Orgs can ask for slots, and then Google grants them. It’s simply not the case that you can be given an OK before that process.

Reading the discussion, it seems your ideas are good, and it looks like a proposal would be well received, but it’s impossible to say more than that. I’d encourage you to apply, assuming the program suits you otherwise.

I see, thanks @carltongibson!

1 Like

Hi @csirmazbendeguz, I’m one of the org admins for Django’s GSoC participation this year. Just wanted to confirm we’ve received your final proposal – thank you for taking it through :slight_smile:

There’s nothing further for you to do. We’ll be reviewing all proposals internally and confirming availability of mentors. Google will announce results on May 1st at 18:00 UTC.

1 Like

Hi @thibaudcolas, does this type of message concern all candidates or only those to whom you have replied?

please DM me if you have concerns about a proposal of yours, and I’ll confirm? The process is the same for everyone, I’ve tried to follow up on forum threads where I found them but they’re easy to miss


Thanks @thibaudcolas, @carltongibson !

Initially, I thought I need some kind of confirmation before applying because the GSoC website says applicants need to reach out to the organization before submitting an application.

hi @thibaudcolas, I’ve sent you a DM on discord following my proposal. I hope it’ll significantly enrich your experience with my proposal.