02 2019 档案
摘要:To be a Pythonista 1. assert 例子1 如果关闭assert, 很危险 def delete_product(prod_id, user): assert user.is_admin(), 'Must be admin' assert store.has_product(p
阅读全文
摘要:参考 https://simpleit.rocks/python/django/generate uml class diagrams from django models/ 运用django extensions(中的graph_models) + pygraphviz(or pydotplus)
阅读全文
摘要:``` from functools import wraps def cache(func): cache = {} @wraps(func) def wrap( args): if args not in cache: cache[args] = func( args) return cache
阅读全文
摘要:参考网址 https://mathiasbynens.github.io/rel noopener/ 例子 target="_blank"会打开一个新tab,如果不加rel="noopener",那么在新tab中会有一个window.opener对象,相当于可以控制打开这个tab的前一个页面,这样会
阅读全文

浙公网安备 33010602011771号