diff --git a/djkit/db/__init__.py b/djkit/db/__init__.py index e69de29..b263fdc 100644 --- a/djkit/db/__init__.py +++ b/djkit/db/__init__.py @@ -0,0 +1,6 @@ +from .fields import MoneyField, NonDatabaseField + +__all__ = ( + "MoneyField", + "NonDatabaseField", +) diff --git a/djkit/db/fields.py b/djkit/db/fields.py index 96f665f..fdcc917 100644 --- a/djkit/db/fields.py +++ b/djkit/db/fields.py @@ -32,20 +32,20 @@ class NonDatabaseField(Field): prevent_kwargs = ["primary_key", "blank", "editable", "unique"] def __init__(self, *args, **kwargs): - for kwarg_name in self.prevent_kwargs: - passed_kwargs = [] + passed_kwargs = [] + for kwarg_name in self.prevent_kwargs: if kwargs.get(kwarg_name, None): passed_kwargs.append(kwarg_name) - if passed_kwargs: - raise exceptions.ValidationError( - "parameters [%s] not allowed in %s" - % ( - ", ".join(passed_kwargs), - self.__class__.__name__, - ) + if passed_kwargs: + raise exceptions.ValidationError( + "parameters [%s] not allowed in %s" + % ( + ", ".join(passed_kwargs), + self.__class__.__name__, ) + ) super().__init__(*args, **kwargs, primary_key=False)