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

use field_name for DeferredAttributes to be version agnostic #22

Merged

Conversation

v-erena
Copy link
Contributor

@v-erena v-erena commented Jan 23, 2020

As Django docs suggest, you can just use the field name of a model field to return the field instance.
https://docs.djangoproject.com/en/3.0/ref/models/meta/#django.db.models.options.Options.get_field

This makes the attribute doc retrieval for a DeferredAttribute easier as it is Django version agnostic.

Note: not quite sure whether I instantiated the DeferredAttribute correctly in the new test. Please have an eye on that.

@codecov-io
Copy link

codecov-io commented Jan 23, 2020

Codecov Report

Merging #22 into master will increase coverage by 5.39%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
+ Coverage   57.28%   62.67%   +5.39%     
==========================================
  Files           6        6              
  Lines         206      217      +11     
==========================================
+ Hits          118      136      +18     
+ Misses         88       81       -7
Impacted Files Coverage Δ
sphinxcontrib_django/docstrings.py 46.97% <100%> (+5.25%) ⬆️
sphinxcontrib_django/tests/test_docstrings.py 96.15% <84.61%> (-3.85%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 364293f...3850df5. Read the comment docs.

@vdboor vdboor merged commit 90e4144 into sphinx-doc:master Jan 26, 2020
@vdboor
Copy link
Contributor

vdboor commented Jan 26, 2020

Thanks a lot!

I've released this as v0.5.1

@v-erena v-erena deleted the improve_attribute_docs_version_agnostic branch January 30, 2020 14:22
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