diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index 307f044f9..b2d2df360 100644 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -24,8 +24,8 @@ import collections import beets from beets.util.functemplate import Template +from beets.dbcore import types from .query import MatchQuery, NullSort -from .types import BASE_TYPE class FormattedMapping(collections.Mapping): @@ -199,7 +199,7 @@ class Model(object): If the field has no explicit type, it is given the base `Type`, which does no conversion. """ - return self._fields.get(key) or self._types.get(key) or BASE_TYPE + return self._fields.get(key) or self._types.get(key) or types.DEFAULT def __getitem__(self, key): """Get the value for a field. Raise a KeyError if the field is diff --git a/beets/dbcore/types.py b/beets/dbcore/types.py index 2738f3425..f96863f9c 100644 --- a/beets/dbcore/types.py +++ b/beets/dbcore/types.py @@ -84,6 +84,10 @@ class Type(object): # Reusable types. +class Default(Type): + pass + + class Integer(Type): """A basic integer type. """ @@ -187,7 +191,7 @@ class Boolean(Type): # Shared instances of common types. -BASE_TYPE = Type() +DEFAULT = Default() INTEGER = Integer() PRIMARY_ID = Id(True) FOREIGN_ID = Id(False)