Skip to content

Instantly share code, notes, and snippets.

@heyitsjames
Last active August 27, 2015 04:47
Show Gist options
  • Save heyitsjames/bbbb126d4a9db7a1d562 to your computer and use it in GitHub Desktop.
Save heyitsjames/bbbb126d4a9db7a1d562 to your computer and use it in GitHub Desktop.
here ya go mikey
# you'll need to import this guy
from datetime import datetime
date_created = datetime.strptime(d['DateCreated'], 'YYYYMMddThh:mm:ss Z')
name = d['Name']
contact_group = d['ContactGroup']
fk_dict = {
'contact_group': 'contact_group_id',
'other_thing': 'other_thing_id'
}
if field in fk_dict:
# use fk_dict[field] as the name of the variable
return Contact(name=name, date_created=date_created, contact_group_id=contact_group)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment