# AUTOGENERATED! DO NOT EDIT! File to edit: 09_base.ipynb (unless otherwise specified).

__all__ = ['base_tightignore', 'BaseObject']

# Cell
from .utils import print_dict, resolve_path

# Cell
base_tightignore = ['# IPython\n', 'share/python-wheels/\n', '\n', '.hypothesis/\n', '# PyInstaller\n', '.scrapy\n', '.ipynb_checkpoints\n', '# SageMath parsed files\n', '.gitconfig', '.tox/\n', '*~\n', '*.bak\n', '.python-version\n', '# .python-version\n', '# Spyder project settings\n', '__pycache__/\n', '*.swp\n', '*.cover\n', 'instance/\n', '# pytest\n', 'celerybeat.pid\n', 'tools/fastai\n', '*.py,cover\n', '.env\n', '*.py[cod]\n', '# dotenv\n', 'dmypy.json\n', '# Flask stuff:\n', '.coverage.*\n', 'db.sqlite3-journal\n', 'Thumbs.db\n', '*.code-workspace\n', '# virtualenv\n', '.spyproject\n', '# pytype static type analyzer\n', '#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.\n', 'coverage.xml\n', '#   install all needed dependencies.\n', '.vscode/\n', '#   intended to run in multiple environments; otherwise, check them in:\n', '*.egg\n', '# mypy\n', 'celerybeat-schedule\n', '.mypy_cache/\n', '# Environments\n', 'htmlcov/\n', '*.log\n', '# Scrapy stuff:\n', '*.whl\n', 'tags\n', '.cache\n', 'env.bak/\n', '# pipenv\n', 'venv.bak/\n', 'cython_debug/\n', 'MANIFEST\n', '.DS_Store?\n', '.pybuilder/\n', '.pyre/\n', '.webassets-cache\n', 'bin/\n', '.ropeproject\n', 'ipython_config.py\n', '# Sphinx documentation\n', '# link checker\n', '#  Usually these files are written by a python script from a template\n', '~*\n', 'develop-eggs/\n', '# Django stuff:\n', '.spyderproject\n', '# symlinks to fastai\n', '# Cython debug symbols\n', '# mkdocs documentation\n', '# Byte-compiled / optimized / DLL files\n', 'cover/\n', '*.mo\n', 'docs_src/fastai\n', '# PyBuilder\n', '.nox/\n', '# Rope project settings\n', '.idea\n', 'lib/\n', '.pytest_cache\n', "#   having no cross-platform support, pipenv may install dependencies that don't work, or not\n", 'env/\n', 'pip-delete-this-directory.txt\n', 'docs/\n', 'tmp*\n', '*.pot\n', 'wheels/\n', 'ENV/\n', 'pip-log.txt\n', 'venv/\n', '/site\n', '# C extensions\n', 'var/\n', '.Trashes\n', 'downloads/\n', 'checklink/cookies.txt\n', '#Pipfile.lock\n', '# osx generated files\n', '.coverage\n', 'eggs/\n', '.venv\n', 'parts/\n', '*.spec\n', '.pytype/\n', '_tmp*\n', '.installed.cfg\n', '# tools/trust-doc-nbs\n', '*.so\n', '*.md\n', '# Installer logs\n', 'lib64/\n', '.Python\n', '*$py.class\n', 'docs_src/.last_checked\n', '.pytest_cache/\n', 'local_settings.py\n', '#   However, in case of collaboration, if having platform-specific dependencies or dependencies\n', '.dmypy.json\n', '# .gitconfig is now autogenerated\n', '# Celery stuff\n', '#  before PyInstaller builds the exe, so as to inject date/other infos into it.\n', '.gitattributes\n', 'docs/_build/\n', '# PEP 582; used by e.g. github.com/David-OConnor/pyflow\n', 'build/\n', '# Distribution / packaging\n', '# Pyre type checker\n', '# Translations\n', '*.manifest\n', '.last_checked\n', '.git/\n', '.DS_Store\n', 'sdist/\n', 'dist/\n', 'target/\n', '__pypackages__/\n', '.gitconfig\n', '.github\n', '.eggs/\n', '*.sage.py\n', 'db.sqlite3\n', 'nosetests.xml\n', 'ehthumbs.db\n', '# pyenv\n', '*.egg-info/\n', '# celery beat schedule file\n', '#   For a library or package, you might want to ignore these files since the code is\n', '.gitignore\n', 'profile_default/\n', '# Unit test / coverage reports\n', '# Jupyter Notebook\n', '.vscode\n']

# Cell
class BaseObject():
    _user_keys = ['user', 'owner', 'created_by', 'added_by']
    display_options = []
    def __init__(self, *args, **kwargs):
        super().__init__()
        for k,v in kwargs.items():
            setattr(self, k, v)

    def __repr__(self):
        return self.__str__()

    def __str__(self):
        return f"<Model: {self.name}>"

    def details(self, verbose=1):
        item_dict = self.__dict__
        d = {}
        for k, v in item_dict.items():
            if k in self.display_options:
                d[k] = v
        if verbose == 1:
            print_dict(item_dict)
        return d