<s> import json <EOL> from api . view import ApiView <EOL> from popong_models . person import Person <EOL> class PersonApi ( ApiView ) : <EOL> model = Person <EOL> kind_single = '<STR_LIT>' <EOL> kind_list = '<STR_LIT>' <EOL> def to_dict ( self , person ) : <EOL> extra_vars = json . loads ( person . extra_vars ) <EOL> d = { <EOL> '<STR_LIT:id>' : person . id , <EOL> '<STR_LIT:name>' : person . name , <EOL> '<STR_LIT>' : person . name_en , <EOL> '<STR_LIT>' : person . name_cn , <EOL> '<STR_LIT>' : person . gender , <EOL> '<STR_LIT>' : person . birthday_date . isoformat ( ) , <EOL> '<STR_LIT>' : extra_vars . get ( '<STR_LIT>' ) , <EOL> '<STR_LIT:address>' : extra_vars . get ( '<STR_LIT:address>' ) , <EOL> '<STR_LIT:image>' : person . image , <EOL> '<STR_LIT>' : person . twitter , <EOL> '<STR_LIT>' : person . facebook , <EOL> '<STR_LIT>' : person . homepage , <EOL> '<STR_LIT>' : person . wiki , <EOL> '<STR_LIT>' : person . blog , <EOL> '<STR_LIT>' : person . education_id , <EOL> '<STR_LIT>' : person . address_id , <EOL> } <EOL> return d </s>
