<gh_stars>0
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()


class BaseInterface:
    """ Interface contains some method """

    @classmethod
    def from_dict(cls, data: dict):
        """
        construct a orm object from a series instead using constructor
        :param data: Data to be assigned
        :return: the class instance.
        """
        obj = cls()
        for k, v in data.items():
            setattr(obj, str(k), v)
        return obj

from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()


class BaseInterface:
    """ Interface contains some method """

    @classmethod
    def from_dict(cls, data: dict):
        """
        construct a orm object from a series instead using constructor
        :param data: Data to be assigned
        :return: the class instance.
        """
        obj = cls()
        for k, v in data.items():
            setattr(obj, str(k), v)
        return obj
Interface contains some method construct a orm object from a series instead using constructor         :param data: Data to be assigned         :return: the class instance.