
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
validate_assignment does not work with root_validator Β· Issue #1971 Β· pydantic/pydantic
Description:
Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())": pydantic version: 1.5.1 pydantic compiled: True install path: /Users/shane/repos/domain-model-specification/Python/.venv/lib/python3.7/site-packages/pydan...
Website Age:
17 years and 9 months (reg. 2007-10-09).
Matching Content Categories {π}
- Technology & Computing
- Social Networks
- Transportation
Content Management System {π}
What CMS is github.com built with?
Github.com relies on WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,000,019 visitors per month in the current month.
However, some sources were not loaded, we suggest to reload the page to get complete results.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 5,013,426 paying customers.
The estimated monthly recurring revenue (MRR) is $21,056,387.
The estimated annual recurring revenues (ARR) are $252,676,649.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
pydantic, issue, prettywood, validateassignment, maxvalue, rootvalidator, check, sign, currentvalue, added, bug, fixvalidation, rootvalidators, caldwellshane, values, fix, validateassignme, mentioned, navigation, pull, requests, actions, security, work, closed, opened, python, import, version, true, clang, model, class, float, docs, validation, set, instance, related, commit, references, samuelcolvin, github, type, projects, milestone, footer, skip, content, menu,
Topics {βοΈ}
/users/shane/repos/domain-model-specification/python/ 7e8cc8c samuelcolvin closed personal information validate_assignment 05f778c prettywood mentioned venv/lib/python3 ['typing-extensions'] minimal comment metadata assignees modified field values pydantic import basemodel pydantic v1 prettywood added pydantic version import pydantic docs model instance root_validator class python assert abs existing instance intended behavior excellent library e98a99e fix regular validator attribute disappear projects milestone milestone relationships check `root_validators` check root_validators max_value = values fail validation validate_assignment opened github type projects current_value = values set max_value model set current_value issue pydantic root_validator values basemodel fix check sign validation type max_value current_value
Payment Methods {π}
- Braintree
Questions {β}
- Already have an account?
- Is that not the intended behavior?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:validate_assignment does not work with root_validator
articleBody:Output of `python -c "import pydantic.utils; print(pydantic.utils.version_info())"`:
```
pydantic version: 1.5.1
pydantic compiled: True
install path: /Users/shane/repos/domain-model-specification/Python/.venv/lib/python3.7/site-packages/pydantic
python version: 3.7.7 (default, Jul 18 2020, 22:28:30) [Clang 11.0.3 (clang-1103.0.32.62)]
platform: Darwin-19.6.0-x86_64-i386-64bit
optional deps. installed: ['typing-extensions']
```
# Minimal Example
I'd like to enforce a condition on a whole model during arbitrary changes in its state:
```py
from pydantic import BaseModel, root_validator
class Example(BaseModel):
current_value: float
max_value: float
class Config:
validate_assignment = True
@root_validator
def current_lessequal_max(cls, values):
current_value = values.get("current_value")
max_value = values.get("max_value")
assert abs(current_value) <= max_value, f"current_value cannot be greater than max_value"
return values
```
Based on my reading of the docs I'd expect this to fail validation if I set `current_value` above `max_value`, or set `max_value` below `current_value`, on an existing instance. Is that not the intended behavior?
Thanks for an excellent library!
author:
url:https://github.com/caldwellshane
type:Person
name:caldwellshane
datePublished:2020-10-05T21:41:23.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:1
url:https://github.com/1971/pydantic/issues/1971
context:https://schema.org
headline:validate_assignment does not work with root_validator
articleBody:Output of `python -c "import pydantic.utils; print(pydantic.utils.version_info())"`:
```
pydantic version: 1.5.1
pydantic compiled: True
install path: /Users/shane/repos/domain-model-specification/Python/.venv/lib/python3.7/site-packages/pydantic
python version: 3.7.7 (default, Jul 18 2020, 22:28:30) [Clang 11.0.3 (clang-1103.0.32.62)]
platform: Darwin-19.6.0-x86_64-i386-64bit
optional deps. installed: ['typing-extensions']
```
# Minimal Example
I'd like to enforce a condition on a whole model during arbitrary changes in its state:
```py
from pydantic import BaseModel, root_validator
class Example(BaseModel):
current_value: float
max_value: float
class Config:
validate_assignment = True
@root_validator
def current_lessequal_max(cls, values):
current_value = values.get("current_value")
max_value = values.get("max_value")
assert abs(current_value) <= max_value, f"current_value cannot be greater than max_value"
return values
```
Based on my reading of the docs I'd expect this to fail validation if I set `current_value` above `max_value`, or set `max_value` below `current_value`, on an existing instance. Is that not the intended behavior?
Thanks for an excellent library!
author:
url:https://github.com/caldwellshane
type:Person
name:caldwellshane
datePublished:2020-10-05T21:41:23.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:1
url:https://github.com/1971/pydantic/issues/1971
Person:
url:https://github.com/caldwellshane
name:caldwellshane
url:https://github.com/caldwellshane
name:caldwellshane
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:1
interactionType:https://schema.org/CommentAction
userInteractionCount:1
External Links {π}(2)
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- GSAP
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net