From 19aecde81e44ca5a70802184989fe7ae5eb51231 Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Thu, 30 Apr 2020 18:27:56 +0200 Subject: [PATCH] BaseObject: Added `kind` field to easily identify type --- jeeves/core/objects.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jeeves/core/objects.py b/jeeves/core/objects.py index 249bf61..4342668 100644 --- a/jeeves/core/objects.py +++ b/jeeves/core/objects.py @@ -1,14 +1,17 @@ import shutil import tempfile from typing import Any, Dict, List, Text, Optional -from pathlib import Path from dataclasses import field import pydantic class BaseObject(pydantic.BaseModel): - pass + kind: Text = None + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.kind = self.__class__.__name__ class Result(BaseObject):