/media/upic/2022/11/18/img_7504.jpg

There is a crack a crack in everything.

That's how the light gets in.

https://jackyu.cn/tech/push-lets-encrypt-cert-to-aliyun-cdn/

Everybody in the office shows great anxiety about their children's education.

It is called "Neijuan" in Chinese.

/media/upic/2022/10/31/oldyangpic1.png

https://music.163.com/#/song?id=1334818292

李娜倮 / 张扎思 / 莫西子诗 / Kawa

One day my friend old Yang said cheers to a singer in the pub, "Hello Lao Yang! to this wonderful night!".

We …

So much bad news on twitter makes me feel stressed and depressed.

So much ridiculous news on weibo makes me feel hopeless.

Wechat is becoming a distraction.

It makes me feel relaxed in this crazy world.

/media/upic/2022/10/17/img_7075.jpg

https://www.dothedev.com/blog/django-admin-list_filter/

There is a white spot on my thumbnail for days. In my hometown, people said that is a sign, a family member will pass away.

I am not sure if …

/media/upic/2022/09/27/sunset_in_pine_az.jpeg

After I turned 40, I found that I sighed increasingly like my father used to...

I tried to retrieve data using id (BigIntegerField) in Django, but returned empty queryset.  

After trying several times, found all of the ids became 6977919360329322000, this id was not in database.

No idea …

insperation by https://twitter.com/realhuazong

适合当写程序时的BGM.

家里一个连接信息板的小显示器是某宝上买的电子垃圾, 经常重启树莓派后显示“无信号”, 像碰运气一样拔插电源成功.

今天实在受不了, 网上查了下, 

vim /boot/config.txt 里把 config_hdmi_boost = 前面的注释去掉, 重启, 搞定.

上一行的注释里写着门板大一样的一行说明: “uncomment to increase signal to HDMI, if you have interference, blanking, or no display”.

apt autoremove --purge

能放出不少个G.

扫码,保安很拽说48小时绿码不能进,大摇大摆尾随一个人进。刚才开车进来啥码都没有扫,荒谬的世界。

这都2022年了, 居然还有人打电话到公司来推销“中文域名”, 多么神奇的穿越...

个人数据成为大数据的一部分,并肆无忌惮以保障安全的名义横行,对古典自由主义者是坏消息,但是,它终究会反噬自己。
用如下语句Group By并算出每个类别的总和, 总是得不出要用的结果, 也就是分组总不成功 queryset = MyModel.objects.all().values('category').annotate(total_amount=Sum('amount'))

打印Sql语句之, print(queryset.query)

发现Group by 条件不只是把category列进去了, 还把另外一个字段A也列了进去, 原来是是模型里用了字段A默认排序, 给自动加到这来了.

清空默认排序, 改成如下语句即可:

queryset = MyModel.objects.all().values('category').order_by().annotate(total_amount=Sum('amount'))
  • 第 1 页 / 共 24 页
  • 下页