def final_expire_at(self):
if self.coupon_expire_type == CouponInfo.FIXED_EXPIRED_TIME:
@@ -131,8 +130,8 @@ class UserCouponInfo(BaseModelMixin):
'coupon_value': self.coupon_value,
'coupon_image_url': self.coupon_image_url,
'is_coupon_admin_writeoff': self.is_coupon_admin_writeoff,
- 'active_at': tc.local_string(self.active_at, format='%Y%m%d'),
- 'expire_at': tc.local_string(self.expire_at, format='%Y-%m-%d'),
+ 'active_at': tc.local_string(utc_dt=self.active_at, format='%Y%m%d'),
+ 'expire_at': tc.local_string(utc_dt=self.expire_at, format='%Y-%m-%d'),
'coupon_valid_period': self.coupon_valid_period,
'coupon_limit_model_ids': self.coupon_limit_model_ids,
'has_actived': self.has_actived,
@@ -1,6 +1,5 @@ |
||
| 1 | 1 |
# -*- coding: utf-8 -*- |
| 2 | 2 |
|
| 3 |
-from daterange_filter.filter import DateRangeFilter |
|
| 4 | 3 |
from django.contrib import admin |
| 5 | 4 |
from django_admin import AdvancedExportExcelModelAdmin, ReadOnlyModelAdmin |
| 6 | 5 |
|
@@ -21,6 +20,5 @@ class SaleclerkSubmitLogInfoAdmin(AdvancedExportExcelModelAdmin, ReadOnlyModelAd |
||
| 21 | 20 |
search_fields = ('code', 'trackingNo', 'distributor_name', 'clerk_name', 'model_name', 'model_uni_name')
|
| 22 | 21 |
|
| 23 | 22 |
|
| 24 |
- |
|
| 25 | 23 |
admin.site.register(SaleclerkIntegralIncomeExpensesInfo, SaleclerkIntegralIncomeExpensesInfoAdmin) |
| 26 | 24 |
admin.site.register(SaleclerkSubmitLogInfo, SaleclerkSubmitLogInfoAdmin) |
@@ -86,7 +86,6 @@ MIDDLEWARE = ( |
||
| 86 | 86 |
'django.middleware.common.CommonMiddleware', |
| 87 | 87 |
# 'django.middleware.csrf.CsrfViewMiddleware', |
| 88 | 88 |
'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 89 |
- 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', |
|
| 90 | 89 |
'django.contrib.messages.middleware.MessageMiddleware', |
| 91 | 90 |
'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 92 | 91 |
'django.middleware.security.SecurityMiddleware', |
@@ -18,8 +18,8 @@ class MchInfoEncryptLogInfo(BaseModelMixin): |
||
| 18 | 18 |
|
| 19 | 19 |
sn = models.CharField(_(u'sn'), max_length=32, blank=True, null=True, help_text=u'序列号', db_index=True) |
| 20 | 20 |
|
| 21 |
- #二维码版本 |
|
| 22 |
- version=models.IntegerField(_(u'version'), default=2, help_text=u'二维码版本', db_index=True) |
|
| 21 |
+ # 二维码版本 |
|
| 22 |
+ version = models.IntegerField(_(u'version'), default=2, help_text=u'二维码版本', db_index=True) |
|
| 23 | 23 |
|
| 24 | 24 |
# 一物一码 |
| 25 | 25 |
application_id = models.IntegerField(_(u'application_id'), default=0, help_text=u'申请单号', db_index=True) |
@@ -3,4 +3,5 @@ from __future__ import unicode_literals |
||
| 3 | 3 |
|
| 4 | 4 |
from django.test import TestCase |
| 5 | 5 |
|
| 6 |
+ |
|
| 6 | 7 |
# Create your tests here. |
@@ -3,4 +3,5 @@ from __future__ import unicode_literals |
||
| 3 | 3 |
|
| 4 | 4 |
from django.shortcuts import render |
| 5 | 5 |
|
| 6 |
+ |
|
| 6 | 7 |
# Create your views here. |
@@ -8,8 +8,9 @@ from django_admin import AdvancedActionsModelAdmin, AdvancedExportExcelModelAdmi |
||
| 8 | 8 |
from django_models_ext import ProvinceShortModelMixin |
| 9 | 9 |
from pysnippets.strsnippets import strip |
| 10 | 10 |
|
| 11 |
-from mch.models import (ActivityInfo, AdministratorInfo, BrandInfo, CameraModelInfo, ConsumeInfoSubmitLogInfo, DistributorInfo, |
|
| 12 |
- LatestAppInfo, LatestAppScreenInfo, ModelInfo, ModelCameraBodyInfo, OperatorInfo, SaleclerkInfo) |
|
| 11 |
+from mch.models import (ActivityInfo, AdministratorInfo, BrandInfo, CameraModelInfo, ConsumeInfoSubmitLogInfo, |
|
| 12 |
+ DistributorInfo, LatestAppInfo, LatestAppScreenInfo, ModelCameraBodyInfo, ModelInfo, |
|
| 13 |
+ OperatorInfo, SaleclerkInfo) |
|
| 13 | 14 |
from utils.redis.rshot import update_member_shot_data |
| 14 | 15 |
|
| 15 | 16 |
|
@@ -337,7 +337,7 @@ class ModelCameraBodyInfo(BaseModelMixin): |
||
| 337 | 337 |
def final_camera_market_time(self): |
| 338 | 338 |
if not self.camera_market_time: |
| 339 | 339 |
return '' |
| 340 |
- return tc.local_string(self.camera_market_time, format='%Y-%m-%d') |
|
| 340 |
+ return tc.local_string(utc_dt=self.camera_market_time, format='%Y-%m-%d') |
|
| 341 | 341 |
|
| 342 | 342 |
@property |
| 343 | 343 |
def data(self): |
@@ -693,7 +693,7 @@ class ConsumeInfoSubmitLogInfo(BaseModelMixin): |
||
| 693 | 693 |
'serialNo': self.serialNo, |
| 694 | 694 |
'integral': model_info.shot_member_integral, |
| 695 | 695 |
'dupload': self.dupload, |
| 696 |
- 'created_at': tc.local_string(self.created_at, format='%Y-%m-%d'), |
|
| 696 |
+ 'created_at': tc.local_string(utc_dt=self.created_at, format='%Y-%m-%d'), |
|
| 697 | 697 |
} |
| 698 | 698 |
|
| 699 | 699 |
|
@@ -737,10 +737,7 @@ class ActivityInfo(BaseModelMixin): |
||
| 737 | 737 |
final_expire_at = self.final_expire_at(created_at=created_at) |
| 738 | 738 |
if not final_expire_at: |
| 739 | 739 |
return '' |
| 740 |
- y = tc.local_string(final_expire_at, format='%Y') |
|
| 741 |
- m = tc.local_string(final_expire_at, format='%m') |
|
| 742 |
- d = tc.local_string(final_expire_at, format='%d') |
|
| 743 |
- return u'{}年{}月{}日'.format(y, m, d)
|
|
| 740 |
+ return tc.local_string(utc_dt=final_expire_at, format=u'%Y年%m月%d日', isuc=True) |
|
| 744 | 741 |
|
| 745 | 742 |
def has_unexpired_activity(self, model_name): |
| 746 | 743 |
return ((self.model_uni_names and model_name in self.model_uni_names) or not self.model_uni_names) and (self.start_at <= tc.utc_datetime() < self.end_at) |
@@ -751,7 +748,6 @@ class ActivityInfo(BaseModelMixin): |
||
| 751 | 748 |
'coupon_value': self.coupon_value, |
| 752 | 749 |
'coupon_has_expired': tc.utc_datetime() >= self.final_expire_at(created_at=created_at), |
| 753 | 750 |
} |
| 754 |
- |
|
| 755 | 751 |
|
| 756 | 752 |
def coupon_info2(self, created_at=None): |
| 757 | 753 |
return self.coupon_info(created_at=created_at), |
@@ -759,17 +755,17 @@ class ActivityInfo(BaseModelMixin): |
||
| 759 | 755 |
@property |
| 760 | 756 |
def coupon_info3(self): |
| 761 | 757 |
try: |
| 762 |
- coupon_info = CouponInfo.objects.get(coupon_id=self.coupon_id) |
|
| 763 |
- return {
|
|
| 764 |
- 'coupon_image': coupon_info.coupon_image_url, |
|
| 765 |
- 'coupon_expire_at': coupon_info.coupon_expire_at, |
|
| 766 |
- 'coupon_value': coupon_info.coupon_value, |
|
| 767 |
- 'coupon_title': coupon_info.coupon_title, |
|
| 768 |
- 'coupon_valid_period': coupon_info.coupon_valid_period, |
|
| 769 |
- 'coupon_id': coupon_info.coupon_id, |
|
| 770 |
- 'activity_id': self.activity_id, |
|
| 771 |
- 'activity_name': self.activity_name, |
|
| 772 |
- } |
|
| 773 |
- except: |
|
| 774 |
- return {}
|
|
| 775 |
- |
|
| 758 |
+ coupon = CouponInfo.objects.get(coupon_id=self.coupon_id) |
|
| 759 |
+ except CouponInfo.DoesNotExist: |
|
| 760 |
+ coupon = None |
|
| 761 |
+ |
|
| 762 |
+ return {
|
|
| 763 |
+ 'coupon_image': coupon.coupon_image_url, |
|
| 764 |
+ 'coupon_expire_at': coupon.coupon_expire_at, |
|
| 765 |
+ 'coupon_value': coupon.coupon_value, |
|
| 766 |
+ 'coupon_title': coupon.coupon_title, |
|
| 767 |
+ 'coupon_valid_period': coupon.coupon_valid_period, |
|
| 768 |
+ 'coupon_id': coupon.coupon_id, |
|
| 769 |
+ 'activity_id': self.activity_id, |
|
| 770 |
+ 'activity_name': self.activity_name, |
|
| 771 |
+ } if coupon else {}
|
@@ -330,7 +330,7 @@ class MemberActivityInfo(BaseModelMixin): |
||
| 330 | 330 |
'activity_id': self.activity_id, |
| 331 | 331 |
'title': self.title, |
| 332 | 332 |
'subtitle': self.subtitle, |
| 333 |
- 'date': tc.local_string(self.date, format='%Y-%m-%d'), |
|
| 333 |
+ 'date': tc.local_string(utc_dt=self.date, format='%Y-%m-%d'), |
|
| 334 | 334 |
'city': self.city, |
| 335 | 335 |
'location': self.location, |
| 336 | 336 |
'lat': self.lat, |
@@ -350,7 +350,7 @@ class MemberActivityInfo(BaseModelMixin): |
||
| 350 | 350 |
'activity_id': self.activity_id, |
| 351 | 351 |
'title': self.title, |
| 352 | 352 |
'subtitle': self.subtitle, |
| 353 |
- 'date': tc.local_string(self.date, format='%Y-%m-%d'), |
|
| 353 |
+ 'date': tc.local_string(utc_dt=self.date, format='%Y-%m-%d'), |
|
| 354 | 354 |
'city': self.city, |
| 355 | 355 |
'location': self.location, |
| 356 | 356 |
'lat': self.lat, |
@@ -2,6 +2,10 @@ |
||
| 2 | 2 |
|
| 3 | 3 |
from __future__ import division |
| 4 | 4 |
|
| 5 |
+import os |
|
| 6 |
+import string |
|
| 7 |
+import sys |
|
| 8 |
+ |
|
| 5 | 9 |
from django.conf import settings |
| 6 | 10 |
from django.db import transaction |
| 7 | 11 |
from django_logit import logit |
@@ -10,16 +14,14 @@ from paginator import pagination |
||
| 10 | 14 |
from TimeConvert import TimeConvert as tc |
| 11 | 15 |
|
| 12 | 16 |
from account.models import UserInfo |
| 17 |
+from coupon.models import UserCouponInfo |
|
| 13 | 18 |
from integral.models import SaleclerkIntegralIncomeExpensesInfo, SaleclerkSubmitLogInfo |
| 14 | 19 |
from logs.models import MchInfoEncryptLogInfo |
| 15 |
-from coupon.models import UserCouponInfo |
|
| 16 | 20 |
from mch.models import BrandInfo, ConsumeInfoSubmitLogInfo, DistributorInfo, ModelInfo, SaleclerkInfo |
| 17 | 21 |
from statistic.models import (DistributorSaleStatisticInfo, ModelSaleStatisticInfo, ProvinceSaleStatisticInfo, |
| 18 | 22 |
SaleclerkSaleStatisticInfo, SaleStatisticInfo) |
| 19 |
-from utils.error.errno_utils import (ProductBrandStatusCode, ProductDistributorStatusCode, ProductMachineStatusCode, |
|
| 20 |
- ProductModelStatusCode, SaleclerkStatusCode, CouponStatusCode) |
|
| 21 |
-import os,sys,string |
|
| 22 |
- |
|
| 23 |
+from utils.error.errno_utils import (CouponStatusCode, ProductBrandStatusCode, ProductDistributorStatusCode, |
|
| 24 |
+ ProductMachineStatusCode, ProductModelStatusCode, SaleclerkStatusCode) |
|
| 23 | 25 |
|
| 24 | 26 |
|
| 25 | 27 |
@logit |
@@ -99,7 +101,7 @@ def clerk_sale_submit_api(request): |
||
| 99 | 101 |
# 是否被消费者扫过 |
| 100 | 102 |
has_scan = ConsumeInfoSubmitLogInfo.objects.filter(model_id=model.model_id, serialNo=serialNo).exists() |
| 101 | 103 |
|
| 102 |
- #是否是新二维码,即统览码2 |
|
| 104 |
+ # 是否是新二维码,即统览码2 |
|
| 103 | 105 |
if not code_version: |
| 104 | 106 |
code_version = 1 |
| 105 | 107 |
code = filter(lambda ch: ch in '0123456789', serialNo) |
@@ -458,6 +460,7 @@ def clerk_query_coupon(request): |
||
| 458 | 460 |
'user_coupon': user_coupon.data |
| 459 | 461 |
}) |
| 460 | 462 |
|
| 463 |
+ |
|
| 461 | 464 |
@logit |
| 462 | 465 |
def clerk_writeoff_coupon(request): |
| 463 | 466 |
brandID = request.POST.get('brand_id', settings.KODO_DEFAULT_BRAND_PK)
|
@@ -490,7 +493,7 @@ def clerk_writeoff_coupon(request): |
||
| 490 | 493 |
try: |
| 491 | 494 |
user_coupon = UserCouponInfo.objects.get(user_coupon_id=user_coupon_id) |
| 492 | 495 |
if user_coupon.has_used: |
| 493 |
- return response(CouponStatusCode.COUPON_HAS_USED) |
|
| 496 |
+ return response(CouponStatusCode.COUPON_HAS_USED) |
|
| 494 | 497 |
elif user_coupon.is_coupon_admin_writeoff: |
| 495 | 498 |
return response(CouponStatusCode.COUPON_PERMISSION_DENIED) |
| 496 | 499 |
elif not user_coupon.has_expired: |
@@ -502,12 +505,13 @@ def clerk_writeoff_coupon(request): |
||
| 502 | 505 |
user_coupon.used_at = tc.utc_datetime() |
| 503 | 506 |
user_coupon.save() |
| 504 | 507 |
else: |
| 505 |
- return response(CouponStatusCode.COUPON_EXPIRED) |
|
| 508 |
+ return response(CouponStatusCode.COUPON_EXPIRED) |
|
| 506 | 509 |
except UserCouponInfo.DoesNotExist: |
| 507 | 510 |
return response(CouponStatusCode.COUPON_NOT_FOUND) |
| 508 | 511 |
|
| 509 | 512 |
return response(200, 'Write Off Coupon Success', u'劵核销成功') |
| 510 | 513 |
|
| 514 |
+ |
|
| 511 | 515 |
@logit |
| 512 | 516 |
def clerk_checkout_serialNo_api(request): |
| 513 | 517 |
brandID = request.POST.get('brand_id', settings.KODO_DEFAULT_BRAND_PK)
|
@@ -128,7 +128,7 @@ def pre_new_models(fpath='./pre/static/models_20180816.xls'): |
||
| 128 | 128 |
nrows = sheet.nrows |
| 129 | 129 |
for idx in range(1, nrows): |
| 130 | 130 |
rvals = sheet.row_values(idx) |
| 131 |
- print rvals |
|
| 131 |
+ print(rvals) |
|
| 132 | 132 |
|
| 133 | 133 |
jancode = strip(rvals[0]) |
| 134 | 134 |
if not jancode: |
@@ -159,18 +159,18 @@ def pre_adaptive_cameras(fpath=u'./pre/static/腾龙镜头适用机型V1.xlsx'): |
||
| 159 | 159 |
for sheet in sheets: |
| 160 | 160 |
model_name = sheet.name |
| 161 | 161 |
model_full_name = sheet.row_values(2)[0] |
| 162 |
- print model_name, model_full_name |
|
| 162 |
+ print(model_name, model_full_name) |
|
| 163 | 163 |
nrows = sheet.nrows |
| 164 | 164 |
for idx in range(4, nrows): |
| 165 | 165 |
rvals = sheet.row_values(idx) |
| 166 |
- print rvals |
|
| 166 |
+ print(rvals) |
|
| 167 | 167 |
for val in rvals: |
| 168 | 168 |
val = strip(val) |
| 169 | 169 |
if not val: |
| 170 | 170 |
continue |
| 171 | 171 |
if u'卡口' in val: |
| 172 | 172 |
continue |
| 173 |
- print val |
|
| 173 |
+ print(val) |
|
| 174 | 174 |
ModelCameraBodyInfo.objects.get_or_create( |
| 175 | 175 |
brand_id=settings.KODO_DEFAULT_BRAND_ID, |
| 176 | 176 |
brand_name=settings.KODO_DEFAULT_BRAND_NAME, |
@@ -249,7 +249,7 @@ def refreshs(): |
||
| 249 | 249 |
logs = ConsumeInfoSubmitLogInfo.objects.filter(verifyResult=1, dupload=False, test_user=False) |
| 250 | 250 |
|
| 251 | 251 |
for log in logs: |
| 252 |
- ymd = tc.local_string(tc.to_local_datetime(log.created_at), format='%Y%m%d') |
|
| 252 |
+ ymd = tc.local_string(utc_dt=log.created_at, format='%Y%m%d') |
|
| 253 | 253 |
|
| 254 | 254 |
try: |
| 255 | 255 |
mdl = ModelInfo.objects.get(model_id=log.model_id) |
@@ -329,7 +329,7 @@ def refreshs(): |
||
| 329 | 329 |
'lat': log.lat, |
| 330 | 330 |
'lon': log.lon, |
| 331 | 331 |
'phone': log.phone, |
| 332 |
- 'ymd': tc.local_string(tc.to_local_datetime(log.created_at), format='%Y%m%d'), |
|
| 332 |
+ 'ymd': tc.local_string(utc_dt=log.created_at, format='%Y%m%d'), |
|
| 333 | 333 |
'model_id': log.model_id, |
| 334 | 334 |
'serialNo': log.serialNo |
| 335 | 335 |
}) |
@@ -345,7 +345,7 @@ def refreshs2(): |
||
| 345 | 345 |
logs = SaleclerkSubmitLogInfo.objects.filter(dupload=False, test_user=False, test_sn=False, status=True) |
| 346 | 346 |
|
| 347 | 347 |
for log in logs: |
| 348 |
- ymd = tc.local_string(tc.to_local_datetime(log.created_at), format='%Y%m%d') |
|
| 348 |
+ ymd = tc.local_string(utc_dt=log.created_at, format='%Y%m%d') |
|
| 349 | 349 |
|
| 350 | 350 |
try: |
| 351 | 351 |
brand = BrandInfo.objects.get(pk=log.brand_pk) |
@@ -1,4 +1,4 @@ |
||
| 1 |
-CodeConvert==2.0.5 |
|
| 1 |
+CodeConvert==3.0.2 |
|
| 2 | 2 |
Pillow==5.0.0 |
| 3 | 3 |
StatusCode==1.0.0 |
| 4 | 4 |
TimeConvert==1.5.1 |
@@ -7,7 +7,7 @@ isoweek==1.3.3 |
||
| 7 | 7 |
jsonfield==2.0.2 |
| 8 | 8 |
mock==2.0.0 |
| 9 | 9 |
monetary==1.0.3 |
| 10 |
-mysqlclient==1.4.5 |
|
| 10 |
+mysqlclient==1.4.6 |
|
| 11 | 11 |
pysnippets==1.1.2 |
| 12 | 12 |
qiniu==7.2.6 |
| 13 | 13 |
requests==2.21.0 |
@@ -1,3 +1,3 @@ |
||
| 1 | 1 |
ipdb==0.11 |
| 2 | 2 |
ipython==5.8.0 |
| 3 |
-uwsgi==2.0.17 |
|
| 3 |
+uwsgi==2.0.18 |
@@ -1,9 +1,9 @@ |
||
| 1 |
-Django==1.11.26 |
|
| 1 |
+Django==1.11.29 |
|
| 2 | 2 |
django-admin==2.0.1 |
| 3 | 3 |
django-cors-headers==3.0.2 |
| 4 | 4 |
django-curtail-uuid==1.0.4 |
| 5 | 5 |
django-daterange-filter==1.3.0 |
| 6 |
-django-detect==1.0.17 |
|
| 6 |
+django-detect==1.0.18 |
|
| 7 | 7 |
django-file-md5==1.0.3 |
| 8 | 8 |
django-file-upload==1.1.1 |
| 9 | 9 |
django-ip==1.0.2 |
@@ -8,7 +8,7 @@ pywe-custom-message==1.0.1 |
||
| 8 | 8 |
pywe-miniapp==1.1.5 |
| 9 | 9 |
pywe-oauth==1.1.1 |
| 10 | 10 |
pywe-pay==1.0.13 |
| 11 |
-pywe-pay-notify==1.0.4 |
|
| 11 |
+pywe-pay-notify==1.0.5 |
|
| 12 | 12 |
pywe-response==1.0.1 |
| 13 | 13 |
pywe-sign==1.1.0 |
| 14 | 14 |
pywe-wxa-cv==1.0.0 |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 |
from django.conf import settings |
| 4 | 4 |
from django_redis_connector import connector |
| 5 | 5 |
from pywe_storage import RedisStorage |
| 6 |
-from pywe_user import get_all_users |
|
| 7 | 6 |
|
| 7 |
+from pywe_user import get_all_users |
|
| 8 | 8 |
from utils.redis.rkeys import SUBSCRIBE_USERINFO_LIST |
| 9 | 9 |
|
| 10 | 10 |
|
@@ -15,7 +15,7 @@ WECHAT = settings.WECHAT |
||
| 15 | 15 |
|
| 16 | 16 |
|
| 17 | 17 |
def fetch_users_func(authorizer_appid, infos): |
| 18 |
- print authorizer_appid, infos |
|
| 18 |
+ print(authorizer_appid, infos) |
|
| 19 | 19 |
openids = infos.get('data', {}).get('openid', [])
|
| 20 | 20 |
for openid in openids: |
| 21 | 21 |
r1.rpushjson(SUBSCRIBE_USERINFO_LIST % authorizer_appid, {
|
@@ -3,4 +3,5 @@ from __future__ import unicode_literals |
||
| 3 | 3 |
|
| 4 | 4 |
from django.test import TestCase |
| 5 | 5 |
|
| 6 |
+ |
|
| 6 | 7 |
# Create your tests here. |
@@ -3,4 +3,5 @@ from __future__ import unicode_literals |
||
| 3 | 3 |
|
| 4 | 4 |
from django.shortcuts import render |
| 5 | 5 |
|
| 6 |
+ |
|
| 6 | 7 |
# Create your views here. |
@@ -256,6 +256,7 @@ class PermissionStatusCode(BaseStatusCode): |
||
| 256 | 256 |
""" 4099xx 权限相关错误码 """ |
| 257 | 257 |
PERMISSION_DENIED = StatusCodeField(409900, 'Permission Denied', description=u'权限不足') |
| 258 | 258 |
|
| 259 |
+ |
|
| 259 | 260 |
class CouponStatusCode(BaseStatusCode): |
| 260 | 261 |
""" 4050xx 优惠劵相关错误码 """ |
| 261 | 262 |
COUPON_NOT_FOUND = StatusCodeField(405001, 'Coupon Not Found', description=u'劵不存在') |
@@ -9,7 +9,7 @@ from utils.redis.rkeys import TODAY_INCOME, TOTAL_INCOME, WEEK_INCOME, WEEK_SOLD |
||
| 9 | 9 |
|
| 10 | 10 |
def set_brief_info(uid, ptype, fee, dt=None): |
| 11 | 11 |
""" 更新简报信息 """ |
| 12 |
- ymd, week = (tc.local_string(tc.to_local_datetime(dt), format='%Y%m%d'), Week.withdate(dt)) if dt else (tc.local_string(format='%Y%m%d'), Week.thisweek().isoformat()) |
|
| 12 |
+ ymd, week = (tc.local_string(utc_dt=dt, format='%Y%m%d'), Week.withdate(dt)) if dt else (tc.local_string(format='%Y%m%d'), Week.thisweek().isoformat()) |
|
| 13 | 13 |
|
| 14 | 14 |
# 总收入 |
| 15 | 15 |
r.incr(TOTAL_INCOME % (uid, ptype), fee) |
@@ -41,7 +41,7 @@ def zbar(path): |
||
| 41 | 41 |
def test_zbar(): |
| 42 | 42 |
# In[4]: test_zbar() |
| 43 | 43 |
# [u'189415'] |
| 44 |
- print zbar(settings.TESTING_ZBAR) |
|
| 44 |
+ print(zbar(settings.TESTING_ZBAR)) |
|
| 45 | 45 |
|
| 46 | 46 |
|
| 47 | 47 |
if __name__ == '__main__': |
@@ -28,4 +28,4 @@ def zbar2(path): |
||
| 28 | 28 |
def test_zbar2(): |
| 29 | 29 |
# In[5]: test_zbar() |
| 30 | 30 |
# [u'189415'] |
| 31 |
- print zbar2(settings.TESTING_ZBAR) |
|
| 31 |
+ print(zbar2(settings.TESTING_ZBAR)) |