from typing import Any

from flask.json import JSONEncoder as Base


class JSONEncoder(Base):
    """
    prepares database objects to be json encoded
    """

    def default(self, o: Any) -> Any:
        copy = o.__dict__.copy()
        del copy['database']
        return copy