Skip to content

Conversation

samuelcolvin
Copy link
Member

@samuelcolvin samuelcolvin commented Oct 9, 2019

Change Summary

deprecated the Model.fields property, use Model.__fields__ instead

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)

@samuelcolvin samuelcolvin changed the title deprecate Model.fields, use Model.__fields__ deprecate Model.fields for Model.__fields__ Oct 9, 2019
@samuelcolvin samuelcolvin force-pushed the deprecate-model-fields branch from 0c9d3b8 to 149034e Compare October 9, 2019 18:28
@codecov
Copy link

codecov bot commented Oct 9, 2019

Codecov Report

Merging #883 into master will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff          @@
##           master   #883   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          16     16           
  Lines        2716   2720    +4     
  Branches      518    521    +3     
=====================================
+ Hits         2716   2720    +4
Impacted Files Coverage Δ
pydantic/env_settings.py 100% <0%> (ø) ⬆️

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 f3dd39c...b0223e9. Read the comment docs.

@samuelcolvin
Copy link
Member Author

.fields was really dumb, in particular it didn't work from a model, only a model instance. This is a breaking change, but I think worth if for such an correction.

@ashears
Copy link
Contributor

ashears commented Oct 11, 2019

The new usage is more logical to me.

@samuelcolvin samuelcolvin merged commit d0c6ec7 into master Oct 11, 2019
@samuelcolvin samuelcolvin deleted the deprecate-model-fields branch October 11, 2019 10:10
andreshndz pushed a commit to cuenca-mx/pydantic that referenced this pull request Jan 17, 2020
* deprecate Model.fields, use Model.__fields__

* correct docs
alexdrydew pushed a commit to alexdrydew/pydantic that referenced this pull request Dec 23, 2023
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants