def get_row(self):
     row = ModelFields.get_row(self)
     row['create_time'] = self.instance.create_time.strftime(
         '%Y-%m-%d %H:%M:%S')
     row['proc_time'] = self.instance.proc_time.strftime(
         '%Y-%m-%d %H:%M:%S')
     return row
Esempio n. 2
0
 def get_row(self):
     dc = ModelFields.get_row(self)
     dc['qianqi_zhunbei'] = json.loads(
         self.instance.qianqi_zhunbei
     ) if self.instance.qianqi_zhunbei else {}
     dc['zaijian_jianguan'] = json.loads(
         dc['zaijian_jianguan']) if dc.get('zaijian_jianguan') else {}
     dc['jungong_yanshou'] = json.loads(
         dc['jungong_yanshou']) if dc.get('jungong_yanshou') else {}
     return dc
Esempio n. 3
0
        def get_row(self):
            row = ModelFields.get_row(self)
            loc = row['loc']
            row['loc'] = row['loc'].x, row['loc'].y
            row['pic'] = json.loads(row['pic'])
            #row['audio']=json.loads(row['audio'])

            distance = 100
            ref_location = loc
            ls = []
            for case in JianduCase.objects.filter(
                    loc__distance_lte=(ref_location, D(m=distance))):
                ls.append(
                    to_dict(case,
                            filt_attr=lambda case:
                            {'loc': [case.loc.x, case.loc.y]},
                            exclude=['org_code']))

            row['near_case'] = ls
            return row
Esempio n. 4
0
 def get_row(self):
     row = ModelFields.get_row(self)
     row['shenqing'] = json.loads(
         self.instance.shenqing) if self.instance.shenqing else {}
     return row