コード例 #1
0
ファイル: meta.py プロジェクト: anonymoose/pvscore
 def get_attrs(self):
     from pvscore.model.core.attribute import Attribute
     return Attribute.find_values(self)
コード例 #2
0
ファイル: meta.py プロジェクト: anonymoose/pvscore
 def set_attr(self, name, value):
     from pvscore.model.core.attribute import Attribute
     attr = Attribute.find(self.__class__.__name__, name)
     if not attr:
         attr = Attribute.create_new(self.__class__.__name__, name)
     attr.set(self, value)
コード例 #3
0
ファイル: meta.py プロジェクト: anonymoose/pvscore
 def get_attr(self, name, default=None):
     from pvscore.model.core.attribute import Attribute
     attr = Attribute.find(self.__class__.__name__, name)
     if attr:
         return attr.get(self)
     return default
コード例 #4
0
ファイル: meta.py プロジェクト: anonymoose/pvscore
 def clear_attributes(self):
     from pvscore.model.core.attribute import Attribute
     pkid = getattr(self, self.__pk__)
     if pkid:
         Attribute.clear_all(self.__class__.__name__, pkid)