Skip to content

Instantly share code, notes, and snippets.

@andybak
Created February 7, 2014 15:47
Show Gist options
  • Save andybak/8865235 to your computer and use it in GitHub Desktop.
Save andybak/8865235 to your computer and use it in GitHub Desktop.
def set_stock_count(self, timestamp, stock_level):
StockCount.objects.filter(timestamp__gte=timestamp, stock_item=self).delete()
StockCount.objects.create(timestamp=timestamp, stock_level=stock_level, stock_item=self)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment