paulguo / f2e.im Goto Github PK
View Code? Open in Web Editor NEWA community for front-end-developer.
Home Page: http://f2e.im
License: BSD 3-Clause "New" or "Revised" License
A community for front-end-developer.
Home Page: http://f2e.im
License: BSD 3-Clause "New" or "Revised" License
I built out a commity on local.Then register for an account,But I cant find the button for create subject.
some one can help me!
# update
if(self.__check("data") and statement == "data:save"):
sets = ""
for data in self.__protected["__data"]:
sets = sets + "%s = '%s', " % (data, self.__valuefix(self.__protected["__data"][data]))
sets = sets.strip().rstrip(",")
sql = sql + " SET %s" % sets
# insert
if(self.__check("data") and statement == "data:add"):
sets = ""
values = ""
for data in self.__protected["__data"]:
sets = sets + "%s, " % data
values = values + "'%s', " % self.__valuefix(self.__protected["__data"][data])
sets = sets.strip().rstrip(",")
values = values.strip().rstrip(",")
sql = sql + " (%s)" % sets
sql = sql + " VALUES (%s)" % values
如上,当update或者insert的值是None的时候,照样被带入sql语句了,这样会导致数据库报错。
以update为例子,假设self.__protected["__data"][data]=None
,那么就会生成语句update tablename set data = None where ...
这样会让数据库报错!
修复方案:
应该先判断一下self.__protected["__data"][data]=None
中的值是否为None,否则不执行下面的生成SQL的语句,insert操作处的修改也一样!
希望作者详细测试一下!
先看了下sql,发现挺多是text的。
text在从mysql传输前端上不占优势。
但text不是必要的说。大部分用varchar就好。
请问slug是要在数据库初始的时候添加一些数据吗?
拉取gravatar
保存时出现405: Method Not Allowed
不是很清楚具体操作, 但是首页没有 description
之类的内容.
按照 GitHub 的习惯, 链接自动进行高亮, 方便用户点击(新窗口打开).
def get_current_user(self):
user_id = self.get_secure_cookie("user")
if not user_id: return None
return self.user_model.get_user_by_uid(int(user_id))
BaseHandler
直接就使用cookie获取id,然后从数据库中获取user的信息,用session的话这里不是应该从session中获取user吗?
搜索了下memcache,只在lib.session中使用了
Introduction:
Welcome to the exciting world of crypto airdrops! Here's a curated list of active airdrops that you wouldn't want to miss. Dive in and explore the opportunities:
Share on Social Media:
🚀 Claim Your Share: Pyth Network Airdrop 🚀 Unlock the potential of $PYTH tokens in this step-by-step guide. Claim yours now! Share on Twitter
— Pyth Network (@pythnetwork) November 28, 2023
Verify Eligibility:
After sharing and connecting your walle
Active Airdrops:
topic_time_diff = datetime.datetime.now() - topic_info["created"]
reputation = topic_info["author_reputation"] or 0
reputation = reputation + 2 * math.log(self.current_user["reputation"] or 0 + topic_time_diff.days + 10, 10)
self.user_model.set_user_base_info_by_uid(topic_info["author_id"], {"reputation": reputation})
有点没看明白,为什么话题被收藏和被取消收藏时,声誉都是增加了?两个Handler的算法写的一样。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.