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
# -*- coding: utf-8 -*- | |
import datetime | |
from south.db import db | |
from south.v2 import SchemaMigration | |
from django.db import models | |
class Migration(SchemaMigration): | |
def forwards(self, orm): |
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
from logging import CRITICAL, DEBUG, ERROR, FATAL, INFO, WARN | |
from reports.models import OutOfStockReport, ProjectedStockTransfers | |
from datetime import date, timedelta | |
import logging | |
logging.basicConfig() | |
logger = logging.getLogger() | |
logger.setLevel(DEBUG) | |
logger.debug('generate_projected_stock_transfers started ...') |
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
# From line 37 beehive/apps/orders/views/__init__.py | |
@render_to("orders/_route_dates.html") | |
def route_dates(request, route_id): | |
route = Route.objects.get(pk=route_id) | |
route_trips = list(route.routetrip_set.all().select_related('route')) | |
route_trips.sort(key=lambda rt: (rt.pull.date() < date.today(), rt.pull)) | |
return locals() | |
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
# What should be done? | |
""" | |
If the original order is paid | |
Deduct the amount of the destroyed order from the debit of the | |
replacement order, leaving a debit or credit memo. | |
else | |
add a credit to the account, for the same value as the debit of the |
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
from reports.tasks import generate_projected_stock_transfers | |
#hopefully running it on a subset will speed things up | |
j2 = Route.objects.get(code='J2') | |
some_drop_ids = [i['id'] for i in j2.drop_points.all().values('id')] | |
generate_projected_stock_transfers(days=3, drop_point_ids=some_drop_ids) |
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
--------------------------------------------------------------------------- | |
NameError Traceback (most recent call last) | |
<ipython-input-15-c39d20790623> in <module>() | |
4 from reports.tasks import generate_projected_stock_transfers | |
5 | |
----> 6 generate_projected_stock_transfers(days=3, drop_point_ids=some_drop_ids) | |
/home/jordan/.envs/beehive/local/lib/python2.7/site-packages/celery/app/task.pyc in __call__(self, *args, **kwargs) | |
328 if self.__self__ is not None: | |
329 return self.run(self.__self__, *args, **kwargs) |
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
https://beehive.azurestandard.com/customer/241910/debits_credits Has a 0.00 credit | |
https://beehive.azurestandard.com/customer/510410/debits_credits Has a 0.00 credit | |
https://beehive.azurestandard.com/customer/420820/debits_credits Double Credit and 0.00 Credit | |
https://beehive.azurestandard.com/customer/160752/debits_credits | |
https://beehive.azurestandard.com/customer/167668/debits_credits | |
https://beehive.azurestandard.com/customer/179102/debits_credits | |
https://beehive.azurestandard.com/customer/280784/debits_credits | |
https://beehive.azurestandard.com/customer/258227/debits_credits | |
https://beehive.azurestandard.com/customer/365678/debits_credits | |
https://beehive.azurestandard.com/customer/180132/debits_credits |
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
$$x^2 + y^3 = 127$$ |
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
"""Functions for integration testing the automation system. Use this | |
to drive the system in testing, create reproducible state, etc. | |
""" | |
import json | |
from gevent_zeromq import zmq | |
from automation.utils import make_message, parse_message |
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
(beehive) λ ~/s/beehive> ./manage.py shell_plus --settings=env.bh_dev | |
From 'auth' autoload: Permission, Group, User | |
From 'contenttypes' autoload: ContentType | |
From 'sessions' autoload: Session | |
From 'sites' autoload: Site | |
From 'comments' autoload: Comment, CommentFlag | |
From 'django_slow_log' autoload: Record | |
From 'django_on_call' autoload: OnCall | |
From 'djcelery' autoload: TaskMeta, TaskSetMeta, IntervalSchedule, CrontabSchedule, PeriodicTasks, PeriodicTask, WorkerState, TaskState | |
From 'countries' autoload: Country, UsState, CanadianProvince |
OlderNewer