Skip to content

Commit

Permalink
fix: doc fields Certidao
Browse files Browse the repository at this point in the history
  • Loading branch information
scjorge committed Jul 4, 2023
1 parent b184b4d commit 77f4940
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
16 changes: 8 additions & 8 deletions docs/src/fields/certidao.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ class Pessoa(BaseModel):
certidao: Certidao


e1 = Pessoa(certidao="203213.01.55.2019.4.03108.343.1021163-86")
e2 = Pessoa(certidao="20321301552019403108343102116386")
p1 = Pessoa(certidao="203213.01.55.2019.4.03108.343.1021163-86")
p2 = Pessoa(certidao="20321301552019403108343102116386")

print(e1)
print(p1)
# > certidao='203213.01.55.2019.4.03108.343.1021163-86'

print(e1.dict())
print(p1.dict())
# > {'certidao': '203213.01.55.2019.4.03108.343.1021163-86'}

print(e1.schema())
print(p1.schema())
# > {'title': 'Pessoa', 'type': 'object', 'properties': {'certidao': {'title': 'Certidao', 'type': 'string', 'format': 'certidao'}}, 'required': ['certidao']}
print(e2)
print(p2)
# > certidao='20321301552019403108343102116386'

print(e2.dict())
print(p2.dict())
# > {'certidao': '20321301552019403108343102116386'}

print(e2.schema())
print(p2.schema())
# > {'title': 'Pessoa', 'type': 'object', 'properties': {'certidao': {'title': 'Certidao', 'type': 'string', 'format': 'certidao'}}, 'required': ['certidao']}
12 changes: 6 additions & 6 deletions docs/src/fields/certidaodigits.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
from pydantic_br import CertidaoDigits


class Empresa(BaseModel):
class Pessoa(BaseModel):
certidao: CertidaoDigits
nome: str


e1 = Empresa(nome="maria", certidao="20321301552019403108343102116386")
p1 = Pessoa(nome="maria", certidao="20321301552019403108343102116386")


print(e1)
print(p1)
# > certidao='20321301552019403108343102116386' nome='maria'

print(e1.dict())
print(p1.dict())
# > {'certidao': '20321301552019403108343102116386', 'nome': 'maria'}

print(e1.schema())
# > {'title': 'Empresa', 'type': 'object', 'properties': {'certidao': {'title': 'Certidao', 'type': 'string', 'format': 'certidao'}, 'nome': {'title': 'Nome', 'type': 'string'}}, 'required': ['certidao', 'nome']}
print(p1.schema())
# > {'title': 'Pessoa', 'type': 'object', 'properties': {'certidao': {'title': 'Certidao', 'type': 'string', 'format': 'certidao'}, 'nome': {'title': 'Nome', 'type': 'string'}}, 'required': ['certidao', 'nome']}
12 changes: 6 additions & 6 deletions docs/src/fields/certidaomask.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
from pydantic_br import CertidaoMask


class Empresa(BaseModel):
class Pessoa(BaseModel):
certidao: CertidaoMask
nome: str


e1 = Empresa(nome="Maria", certidao="203213.01.55.2019.4.03108.343.1021163-86")
p1 = Pessoa(nome="Maria", certidao="203213.01.55.2019.4.03108.343.1021163-86")

print(e1)
print(p1)
# > certidao='203213.01.55.2019.4.03108.343.1021163-86' nome='Maria'

print(e1.dict())
print(p1.dict())
# > {'certidao': '203213.01.55.2019.4.03108.343.1021163-86', 'nome': 'Maria'}

print(e1.schema())
# > {'title': 'Empresa', 'type': 'object', 'properties': {'certidao': {'title': 'Certidao', 'type': 'string', 'format': 'certidao'}, 'nome': {'title': 'Nome', 'type': 'string'}}, 'required': ['certidao', 'nome']}
print(p1.schema())
# > {'title': 'Pessoa', 'type': 'object', 'properties': {'certidao': {'title': 'Certidao', 'type': 'string', 'format': 'certidao'}, 'nome': {'title': 'Nome', 'type': 'string'}}, 'required': ['certidao', 'nome']}
40 changes: 20 additions & 20 deletions docs/usage/field_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,24 +353,24 @@ class Pessoa(BaseModel):
certidao: Certidao


e1 = Pessoa(certidao="203213.01.55.2019.4.03108.343.1021163-86")
e2 = Pessoa(certidao="20321301552019403108343102116386")
p1 = Pessoa(certidao="203213.01.55.2019.4.03108.343.1021163-86")
p2 = Pessoa(certidao="20321301552019403108343102116386")

print(e1)
print(p1)
# > certidao='203213.01.55.2019.4.03108.343.1021163-86'

print(e1.dict())
print(p1.dict())
# > {'certidao': '203213.01.55.2019.4.03108.343.1021163-86'}

print(e1.schema())
print(p1.schema())
# > {'title': 'Pessoa', 'type': 'object', 'properties': {'certidao': {'title': 'Certidao', 'type': 'string', 'format': 'certidao'}}, 'required': ['certidao']}
print(e2)
print(p2)
# > certidao='20321301552019403108343102116386'

print(e2.dict())
print(p2.dict())
# > {'certidao': '20321301552019403108343102116386'}

print(e2.schema())
print(p2.schema())
# > {'title': 'Pessoa', 'type': 'object', 'properties': {'certidao': {'title': 'Certidao', 'type': 'string', 'format': 'certidao'}}, 'required': ['certidao']}
```

Expand All @@ -384,21 +384,21 @@ from pydantic import BaseModel
from pydantic_br import CertidaoMask


class Empresa(BaseModel):
class Pessoa(BaseModel):
certidao: CertidaoMask
nome: str


e1 = Empresa(nome="Maria", certidao="203213.01.55.2019.4.03108.343.1021163-86")
p1 = Pessoa(nome="Maria", certidao="203213.01.55.2019.4.03108.343.1021163-86")

print(e1)
print(p1)
# > certidao='203213.01.55.2019.4.03108.343.1021163-86' nome='Maria'

print(e1.dict())
print(p1.dict())
# > {'certidao': '203213.01.55.2019.4.03108.343.1021163-86', 'nome': 'Maria'}

print(e1.schema())
# > {'title': 'Empresa', 'type': 'object', 'properties': {'certidao': {'title': 'Certidao', 'type': 'string', 'format': 'certidao'}, 'nome': {'title': 'Nome', 'type': 'string'}}, 'required': ['certidao', 'nome']}
print(p1.schema())
# > {'title': 'Pessoa', 'type': 'object', 'properties': {'certidao': {'title': 'Certidao', 'type': 'string', 'format': 'certidao'}, 'nome': {'title': 'Nome', 'type': 'string'}}, 'required': ['certidao', 'nome']}
```

### CertidaoDigits
Expand All @@ -411,20 +411,20 @@ from pydantic import BaseModel
from pydantic_br import CertidaoDigits


class Empresa(BaseModel):
class Pessoa(BaseModel):
certidao: CertidaoDigits
nome: str


e1 = Empresa(nome="maria", certidao="20321301552019403108343102116386")
p1 = Pessoa(nome="maria", certidao="20321301552019403108343102116386")


print(e1)
print(p1)
# > certidao='20321301552019403108343102116386' nome='maria'

print(e1.dict())
print(p1.dict())
# > {'certidao': '20321301552019403108343102116386', 'nome': 'maria'}

print(e1.schema())
# > {'title': 'Empresa', 'type': 'object', 'properties': {'certidao': {'title': 'Certidao', 'type': 'string', 'format': 'certidao'}, 'nome': {'title': 'Nome', 'type': 'string'}}, 'required': ['certidao', 'nome']}
print(p1.schema())
# > {'title': 'Pessoa', 'type': 'object', 'properties': {'certidao': {'title': 'Certidao', 'type': 'string', 'format': 'certidao'}, 'nome': {'title': 'Nome', 'type': 'string'}}, 'required': ['certidao', 'nome']}
```

0 comments on commit 77f4940

Please sign in to comment.