Created
July 30, 2013 22:40
-
-
Save shofetim/6117712 to your computer and use it in GitHub Desktop.
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
def react_to_purchasing_status(self): | |
if self.purchasing_status >= PURCHASE_STATUS_SUBMITTED and self.submitted_at is None: | |
self.submitted_at = datetime.now() | |
else: | |
self.submitted_at = None | |
if self.purchasing_status == PURCHASE_STATUS_SUBMITTED: | |
for line in self.purchaseline_set.filter(unit_cost=None): | |
line.unit_cost = line.promotional_cost_at_submit_time | |
line.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment