Skip to content

Setting fixed length to a string #41

@ahopkins

Description

@ahopkins
  • middle version: 0.2.2
  • Python version: 3.7.3
  • Operating System: Alpine Linux v3.9

Description

Set a length requirement for a str

What I Did

class Foo(middle.Model):
    bar: str = middle.field(min_length=4, max_length=4)
ValueError: The 'min_length' keyword value must not be equal or greater than the 'max_length' keyword value. 

This seems like it should be possible. Or, perhaps:

bar: str = middle.field(length=4)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions