def transform_deal(self, obj): out = dict( title = obj.title, date_expires = obj.end_date, # ... ) return out