예제 #1
0
파일: Grid.py 프로젝트: johntyree/fd_adi
    def __str__(self):
        keys = utils.attr_dict(self)
        keys['hexid'] = hex(id(self))
        keys['ndim'] = self.ndim
        return ("""
Grid object <%(hexid)s>
    mesh: (%(_mesh)s
    ndim: %(ndim)i
    dx  : %(dx)s
    shape: %(shape)s
    domain:\n%(domain)s
        """ % keys)
예제 #2
0
파일: Grid.py 프로젝트: johntyree/fd_adi
    def __str__(self):
        keys = utils.attr_dict(self)
        keys["hexid"] = hex(id(self))
        keys["ndim"] = self.ndim
        return (
            """
Grid object <%(hexid)s>
    mesh: (%(_mesh)s
    ndim: %(ndim)i
    dx  : %(dx)s
    shape: %(shape)s
    domain:\n%(domain)s
        """
            % keys
        )
예제 #3
0
파일: base.py 프로젝트: yoCruzer/wuditoo
 def _before_find(self, primary_key_value):
     if primary_key_value and self.table in ('user', 'photo'):
         redis_key = REDIS_KEY['TABLE_ITEMS'].format(table = self.table)
         redis_client = get_redis_client()
         result = redis_client.hget(redis_key, primary_key_value)
         return attr_dict(json.loads(result)) if result else None