I have the following list and dict :
[u'customer_id', u'bank_statement', u'pay_stub']
and
REQUEST_DOCUMENT_TYPE_CHOICES = (
('void_cheque', _('Void Cheque')),
('pay_stub', _('Pay Stub')),
('bank_statement', _('Bank Statement (31 days)')),
('bank_statement_60', _('Bank Statement (60 days)')),
('csst_statement', _('CSST Statement')),
('saaq_statement', _('SAAQ Statement')),
('cara_statement', _('CARA Statement')),
('insurance_letter', _('Insurance Letter')),
('t4', _('T4')),
('welfare_chart', _('Welfare Chart')),
('raqp_chart', _('RAQP Chart')),
('customer_id', _('Customer ID')),
('proof_of_residence', _('Proof Of Residence')),
('bankruptcy_proof', _('Bankruptcy Proof')),
('consumer_proposal', _('Consumer Proposal')),
('signed_contract', _('Signed Contract')),
)
I already know I could access each element on that way
list = dict(Meta.REQUEST_DOCUMENT_TYPE_CHOICES)
list['void_cheque']
The purpose of this question is to convert the first list into
['Void Cheque', 'Bank Statement (31 days)', 'Pay Stub']
How, with a short line, could I map the first list into that last list in using the dictionnary? I know I could do it with simple for
statement, but I want to code it under a single line in such a way I could return it inside a function... return your_code