Created
November 6, 2012 23:46
-
-
Save wesrog/4028523 to your computer and use it in GitHub Desktop.
Python idiom 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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