Created
April 18, 2012 04:57
-
-
Save mik3y/2411186 to your computer and use it in GitHub Desktop.
Update pykeg drinks
This file contains 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
# Manually reset the volume of all drinks in a session. | |
# You should run this by hand in "kegbot-admin.py shell" | |
# Be sure to run "kegbot-admin.py kb_regen_stats" after doing so. | |
ML_PER_TICK = 1.0/2200 # change me | |
SESSION_ID = 123 # change me | |
# Should not need to edit past here. | |
from pykeg.core import models | |
session = models.DrinkingSession.objects.get(seqn=SESSION) | |
drinks = session.drinks.all() | |
print "Adjusting session: %s" % session | |
for d in drinks: | |
d.volume_ml = d.ticks * ML_PER_TICK | |
d.save() | |
print " + %s" % d | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment