Skip to content

Instantly share code, notes, and snippets.

View calvinchengx's full-sized avatar
:octocat:
Focusing

Calvin Cheng calvinchengx

:octocat:
Focusing
View GitHub Profile
@calvinchengx
calvinchengx / pyrefactors.py
Created November 14, 2012 02:53 — forked from geeknam/pyrefactors.py
Python refactors
"""
Use setattr
"""
# Normal
item.price = self.request['price']
item.quantity = self.request['quantity']
item.shipping = self.request['shipping']
item.save()