Comments (2)
我的django 版本是1.9 ,问题出在了get_all_field_names()方法(此方法在1.8后已经被删除了),作者有提示让测试了,我没有注意到,但是大家还是要注意到自己版本如果大于1.8会存在问题:
def amend_model_params(self, **kwargs):
params = kwargs.copy()
if 'subscribe_time' in params:
params['subscribe_time'] = \
datetime.fromtimestamp(params['subscribe_time'], pytz.utc)
params['subscribe'] = bool(params['subscribe'])
params['last_login'] = timezone.now()
# TODO get_all_field_names is deprecated, need test case here
field_list = WechatUser._meta.get_all_field_names()
for field in params.keys():
if field not in field_list:
params.pop(field)
return params
我是这样修改的:
def amend_model_params(self, **kwargs):
params = kwargs.copy()
if 'subscribe_time' in params:
params['subscribe_time'] = \
datetime.fromtimestamp(params['subscribe_time'], pytz.utc)
params['subscribe'] = bool(params['subscribe'])
params['last_login'] = timezone.now()
# TODO get_all_field_names is deprecated, need test case here
field_list = WechatUser._meta.fields
fields = []
for field in field_list:
fields.append(field.name)
for field in params.keys():
if field not in fields:
params.pop(field)
return params
from wecron.
这是你本地数据库的报错吧,跟WeCron没有关系。。。
from wecron.
Related Issues (16)
- hi HOT 2
- 大佬公众号什么时候恢复 HOT 6
- 您好,请问服务什么时候能恢复呢? HOT 8
- 对你的 todo_parser 类很干兴趣,赞一个 HOT 1
- 有考虑Web版本或插件版本吗? HOT 1
- 提问 HOT 1
- 能实现一下“每个月最后一个周五”或者“每隔4周的周四”这种定时吗? HOT 1
- 弄个docker镜像?
- OK HOT 1
- 你好,请问下 模版消息是使用哪个行业的? HOT 1
- 能加个每小时或者半小时提醒吗? 比如半小时动一动 HOT 6
- 请教一下Django的问题 HOT 3
- bug
- 程序执行报错 KeyError: u'wechatpy:jsapi_ticket' HOT 2
- 自建公众号使用的话,需要在公众平台模板消息新建模板,替换模板ID HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wecron.