diff --git a/jsonmodels/builders.py b/jsonmodels/builders.py index c63ec16..d2738b2 100644 --- a/jsonmodels/builders.py +++ b/jsonmodels/builders.py @@ -1,6 +1,5 @@ """Builders to generate in memory representation of model and fields tree.""" - from collections import defaultdict from . import errors diff --git a/jsonmodels/collections.py b/jsonmodels/collections.py index 5bdf869..9337172 100644 --- a/jsonmodels/collections.py +++ b/jsonmodels/collections.py @@ -1,5 +1,4 @@ class ModelCollection(list): - """`ModelCollection` is list which validates stored values. Validation is made with use of field passed to `__init__` at each point, diff --git a/jsonmodels/fields.py b/jsonmodels/fields.py index 91b0f41..0243f93 100644 --- a/jsonmodels/fields.py +++ b/jsonmodels/fields.py @@ -13,7 +13,6 @@ class BaseField: - """Base class for all fields.""" types = None @@ -142,14 +141,12 @@ def structue_name(self, default): class StringField(BaseField): - """String field.""" types = (str,) class IntField(BaseField): - """Integer field.""" types = (int,) @@ -163,14 +160,12 @@ def parse_value(self, value): class FloatField(BaseField): - """Float field.""" types = (float, int) class BoolField(BaseField): - """Bool field.""" types = (bool,) @@ -182,14 +177,12 @@ def parse_value(self, value): class DictField(BaseField): - """Dict field.""" types = (dict,) class ListField(BaseField): - """List field.""" types = (list,) @@ -300,7 +293,6 @@ def to_struct(self, values): class EmbeddedField(BaseField): - """Field for embedded models.""" def __init__(self, model_types, *args, **kwargs): @@ -403,7 +395,6 @@ def _import(module_name, type_name): class TimeField(StringField): - """Time field.""" types = (datetime.time,) @@ -434,7 +425,6 @@ def parse_value(self, value): class DateField(StringField): - """Date field.""" types = (datetime.date,) @@ -466,7 +456,6 @@ def parse_value(self, value): class DateTimeField(StringField): - """Datetime field.""" types = (datetime.datetime,) diff --git a/jsonmodels/models.py b/jsonmodels/models.py index 35610c0..2ca1fcc 100644 --- a/jsonmodels/models.py +++ b/jsonmodels/models.py @@ -24,7 +24,6 @@ def validate_fields(attributes): class Base(metaclass=JsonmodelMeta): - """Base class for all models.""" def __init__(self, **kwargs): diff --git a/jsonmodels/parsers.py b/jsonmodels/parsers.py index 36af245..eecacef 100644 --- a/jsonmodels/parsers.py +++ b/jsonmodels/parsers.py @@ -1,4 +1,5 @@ """Parsers to change model structure into different ones.""" + import inspect from . import builders, errors, fields diff --git a/jsonmodels/validators.py b/jsonmodels/validators.py index adadb7f..a2cd43f 100644 --- a/jsonmodels/validators.py +++ b/jsonmodels/validators.py @@ -1,4 +1,5 @@ """Predefined validators.""" + import re from functools import reduce @@ -7,7 +8,6 @@ class Min: - """Validator for minimum value.""" def __init__(self, minimum_value, exclusive=False): @@ -41,7 +41,6 @@ def modify_schema(self, field_schema): class Max: - """Validator for maximum value.""" def __init__(self, maximum_value, exclusive=False): @@ -75,7 +74,6 @@ def modify_schema(self, field_schema): class Regex: - """Validator for regular expressions.""" FLAGS = { @@ -134,7 +132,6 @@ def modify_schema(self, field_schema): class Length: - """Validator for length.""" def __init__(self, minimum_value=None, maximum_value=None): @@ -186,7 +183,6 @@ def modify_schema(self, field_schema): class Enum: - """Validator for enums.""" def __init__(self, *choices):