コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
4595 ビュー

i have this 

res['domain']=

{'grade_ids':[('cadre_id', '=',self.cadre_id.id)], 

 'employee_ids':[('shift_line_ids.cadre_id','=',self.cadre_id.id)]}


i want this 

i need to Append/update  ,('shift_line_ids.grade_id','=',self.grade_id.id) value 

res['domain']=

{'grade_ids':[('cadre_id', '=',self.cadre_id.id)], 

 'employee_ids':[('shift_line_ids.cadre_id','=',self.cadre_id.id),('shift_line_ids.grade_id','=',self.grade_id.id)]}

how i can ? any help/tips 

アバター
破棄
最善の回答

Hi,

You can try like this,

res['domain']['employee_ids'].append(('shift_line_ids.grade_id','=',self.grade_id.id))

Refer : Append data to a list within a dict

Thanks

アバター
破棄
著作者

perfect working .... thanks Niyas

最善の回答

First you need to append domains in employee_ids and then you can update dict.

eg:

employee_ids.append(values)
res['domain'] = {'employee_ids': employee_ids}
アバター
破棄
関連投稿 返信 ビュー 活動
5
12月 23
18689
2
11月 21
33053
7
3月 20
7594
1
10月 18
9987
1
3月 17
5363