model.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:Orator-Google-App-Engine 作者: MakarenaLabs 项目源码 文件源码
def get_attribute(self, key, original=None):
        """
        Get an attribute from the model.

        :param key: The attribute to get
        :type key: str
        """
        in_attributes = key in self.__attributes

        if in_attributes:
            return self._get_attribute_value(key)

        if key in self.__relations:
            return self.__relations[key]

        relation = original or super(Model, self).__getattribute__(key)

        if relation:
            return self._get_relationship_from_method(key, relation)

        raise AttributeError(key)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号