Skip to content

Instantly share code, notes, and snippets.

@wesrog
Created November 6, 2012 23:46
Show Gist options
  • Save wesrog/4028523 to your computer and use it in GitHub Desktop.
Save wesrog/4028523 to your computer and use it in GitHub Desktop.
Python idiom 2
# This
item_details = {
'item_id': int('%d%d%d' % (release_id, user['uid'], c)),
'uid': user['uid'],
'cond': cond,
'price': 5.00,
'curr_id': user['seller_curr_id'],
'release_id': release_id,
'post_ts': SYSDATE,
'status': 'For Sale',
'accept_offer': 'Y'
}
item = SellItem.new(**item_details)
item.setFee()
# Instead of this
si = SellItem.new(item_id=int('%d%d%d' % (release_id, user['uid'], c)),
uid=user['uid'],
cond=cond,
price=5.00,
curr_id=user['seller_curr_id'],
release_id=release_id,
post_ts=SYSDATE,
selling_fee=0.42,
status='For Sale',
accept_offer='Y',
)
si.setFee()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment