Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_models() and __contains__() in registries.py #48

Closed

Conversation

ghkdxofla
Copy link
Contributor

In django-elasticsearch-dsl's registries.py, a public method exists to retrieve a list of registered models.
Also, it can easily check if a particular model is registered by defining the __contains__ method.
The change is to add these two functions.

@ghkdxofla ghkdxofla marked this pull request as draft January 12, 2024 07:21
@codecov-commenter
Copy link

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (783e89a) 95.65% compared to head (635cca0) 95.34%.

Files Patch % Lines
django_opensearch_dsl/registries.py 50.00% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #48      +/-   ##
==========================================
- Coverage   95.65%   95.34%   -0.32%     
==========================================
  Files          12       12              
  Lines         576      580       +4     
  Branches       80       80              
==========================================
+ Hits          551      553       +2     
- Misses         21       23       +2     
  Partials        4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ghkdxofla ghkdxofla marked this pull request as ready for review January 12, 2024 07:51
Copy link
Member

@qcoumes qcoumes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution !

Can you please add a test for these two methods in tests/tests/test_registries.py?

@qcoumes
Copy link
Member

qcoumes commented Mar 18, 2024

Manually merged in be22b93.

@qcoumes qcoumes closed this Mar 18, 2024
@ghkdxofla
Copy link
Contributor Author

Manually merged in be22b93.

@qcoumes
Oh... I missed this comment... :(
I checked the commit, and the test code was added just fine!
Next time, I'll add the test code and contribute it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants