Skip to content

Commit fda123b

Browse files
committed
update README.md
1 parent 7a5fa8d commit fda123b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ class MyModel(BaseModel):
8282

8383
```python
8484
class MyModelSerializer:
85-
name = CharField(allow_null=False, required=True)
85+
name = CharField(allow_null=False, required=True, allow_blank=True)
8686
addresses = ListField(
8787
allow_empty=True,
8888
allow_null=False,
89-
child=CharField(allow_null=False),
89+
child=CharField(allow_null=False, allow_blank=True),
9090
required=True,
9191
)
9292
```
@@ -370,7 +370,7 @@ Additional field properties are mapped as follows (`pydantic` -> `DRF`):
370370

371371
- `description` -> `help_text`
372372
- `title` -> `label`
373-
- `StringConstraints` -> `min_length` and `max_length`
373+
- `StringConstraints` -> `min_length` and `max_length` and `allow_blank`
374374
- `pattern` -> Uses the specialized `RegexField` serializer field
375375
- `max_digits` and `decimal_places` are carried over
376376
(used for `Decimal` types, with the current decimal context precision)

0 commit comments

Comments
 (0)