Commit Graph

14 Commits

Author SHA1 Message Date
Sebastián Ramírez d9bbb05a16 Implement Optional required (#1031)
* Implement Optional required, when creating a ModelField(required=True), make it persist

* Add test for nullable required

* Improve formatting of Undefined custom object

* Refactor field infer/creation with Undefined to make it idempotent

Needed for when _type_analysis is re-run in Generics

* Add PR changes

* Increment/update tests with code review

* Update/refactor Undefined implementation with code review

* Fix BoolUndefined as string type for mypy, not runtime

* Add docs about required Optional

* Add explicit tests for Any

* Apply code review requested changes

* move tests out of test_validators.py
2019-11-28 16:48:33 +00:00
dmontagu 643266944c Support typing.Literal in python 3.8 (#1027)
* Support typing.Literal in python 3.8

* Improve import pattern for Literal

* Update references to  in docs

* Try to get build to pass
2019-11-25 11:32:01 +00:00
nwalsh1995 c6e192db04 fix typo: 'frozonset' -> 'frozenset' (#998) 2019-11-15 20:26:38 +00:00
Daniel Smith b92e74d0a6 Bytesize (#977)
* ByteSize object

* Human readable format

* Lint, tests, and docs

* Update pydantic/errors.py

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>

* Update pydantic/types.py

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>

* Update pydantic/types.py

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>

* Allows human readable decimal descriptor

* Review comments

* Less verbose testing

* ByteSize docs

* Reworks valid units

* Missing type

* tweak tests
2019-11-09 12:39:02 +00:00
Samuel Colvin 17b5ff42c1 renaming docs examples (#972)
* renaming docs examples

* tweaks
2019-11-07 14:40:44 +00:00
Samuel Colvin 1d3f7824ec Fix broken Any and TypeVar behaviour (#962)
* tests for broken Dict behaviour

* fix Any, support TypeVar

* change type of field.type_

* add docs and example for TypeVar
2019-11-07 12:31:26 +00:00
Scott P 347be1cc3c Fixed PositiveFloat and PositiveInt description (#945)
* Fixed PositiveFloat and PositiveInt description

changed "negative" word to "positive"

* "a int" -> "an int"
2019-10-30 13:24:48 +01:00
Samuel Colvin 7db098fa49 get item type in get_annotation_from_field_info (#909)
* get item type in get_annotation_from_field_info, fix #779

* check constraints are enforced

* add change

* tests for phony constraints

* rewrite get_annotation_from_field_info

* fix tests

* add constaint enforcement to docs

* fix get_annotation_from_field_info coverage

* fix linting

* update docs as per @tiangolo suggestions
2019-10-18 17:41:10 +01:00
Trim21 afba60f112 update docs for bool to match code (#911)
* update docs for bool to match code

* add changelog
2019-10-17 14:57:56 +01:00
Samuel Colvin e7227db41a Insert prints in docs. (#895)
* starting insert prints

* working exec_script

* remove prints, fix exec_examples.py

* more cleanup of examples, better model printing

* upgrade netlify runtime

* extra docs deps

* few more small tweaks
2019-10-14 16:40:25 +01:00
retnikt 97b163db5f fix formatting for datetime nested bullet points in docs/usage/types.md (#887) 2019-10-11 17:26:02 +01:00
Samuel Colvin f3dd39c1bb Few more tweaks to docs (#879) 2019-10-10 12:10:39 +01:00
dmontagu beb57364d2 Lots of minor docs tweaks (#877)
* Lots of minor changes

* More tweaks

* Remove git conflicts

* suggested tweaks
2019-10-10 12:00:22 +01:00
Samuel Colvin 33b7d52d31 moving docs to mkdocs (#856)
* moving docs to mkdocs

* transfering readme to md and more

* fixing build

* splitting usage.md

* improving schema.md and index.md

* fix make_history.rst

* models intro

* working on data conversation and required fields

* more fixes to models.md

* list all standard types supported

* list of pydantic types

* tweaks

* update links in code

* Apply suggestions from code review

incorporate @dmontagu's suggestions.

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>

* Apply suggestions from code review

more missed suggestions.

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>

* Apply suggestions from code review

more corrects.

* cleanup

* Field order warning

* fix and regenerate benchmarks

* format examples better, cleanup

* improve schema mapping table

* correct highlighting file types in schema.md

* add redirects in javascript

* add logo
2019-10-07 17:19:01 +01:00