Skip to content

Instantly share code, notes, and snippets.

@AllenJonathan
Last active March 19, 2024 07:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save AllenJonathan/daa714160858004b3adef90d416574da to your computer and use it in GitHub Desktop.
Save AllenJonathan/daa714160858004b3adef90d416574da to your computer and use it in GitHub Desktop.
Per-Field-Instance lookups

Per-Field-Instance lookups

Contributer: Allen Jonathan David Mentors: Mariusz Felisiak, Simon Charette Organization: Django Software Foundation

Goal

This project aims to add support to register and unregister custom lookups on a model’s Field instances. As of now, the Lookup API can only register and unregister lookups on Field classes. So a custom lookup added or overridden to a field affects all models which have that field, thus limiting the customizability of model lookups. Support for custom lookups for a particular field is the main goal of this project.

The detailed proposal for this project can be found here: GSoC-Proposal

The project

The project had already some work done by Simon Charette. I first worked on testing the existing implemetation. Later class_or_instance_method, register_instance_lookup, unregister_instance_lookup and get_instance_lookup were added. Then I fixed existing tests, worked on writing tests for the new feature (instance lookups) and added addition tests for already existing class lookups tests. Lastly I worked on the documentation explaining the new feature and version changed annotations.

The project pull request - Allowed registering lookups per field instances.

Main tasks

  • Tested class_or_instance_method which return repective methods based on call type.
  • Added support for register_instance_lookup, unregister_instance_lookup and get_instance_lookup.
  • Added support for reverse relations.
  • Fixed existing tests and wrote addition tests for the feature.
  • Wrote the documentation explaining the new feature.

Additional tasks

Since the project was almost done earlier than expected, I worked on a few addition tickets.

@123-Arora
Copy link

I want to contribute in this project . I want to bring expereince from the contribution in this project , and I confirm that i will contriubute my time in this project .
can i be contribute in this project .
I want to work on this project on python because i can solve all problems related to python .

MY MAIL ID : arorajatin3410@gmaill.com
please reply me via this mail id
I will wait and i am so excited to contribute in this project.

@Pratikdate
Copy link

I want to contribute in this project . I want to bring expereince from the contribution in this project , and I confirm that i will contriubute my time in this project .
can i be contribute in this project .
I want to work on this project on python because i can solve all problems related to python .

MY MAIL ID : pdate73@gmaill.com
please reply me via this mail id
I will wait and i am so excited to contribute in this project.

@Akshat111111
Copy link

I'd want to contribute to this project. I wish to gain experience through my participation in this project, and I certify that I will contribute my time to it.
Can I participate in this project?
I wish to work on this Python project since I can answer any Python difficulty.
MY E-MAIL ADDRESS IS: akshat.sharma.pandri@gmail.com

Please respond to me at this email address.

I will wait, and I am really pleased to be a part of this endeavor.

@Ashok-Prajapati2
Copy link

I want to contribute to this project. I wish to gain experience through my participation in this project, and I certify that I will contribute my time to it.
May I participate in this project?
I wish to work on this Python project since I can answer any Python difficulty.
MY E-MAIL ADDRESS IS: ap86963163@gmail.com
Please respond to me at this email address.

I will wait, and I am really so excited to contribute in this project.

@adreeja06
Copy link

I am eager to contribute to your project and gain valuable experience through my active participation. I assure you of my commitment to dedicating time to the project. I am particularly interested in working on this Python project, as I am confident in my ability to address any Python-related challenges. You can reach me at adreejamahato@gmail.com. I look forward to your response and the opportunity to contribute to your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment