Django 多字段可选查询 重点是使用字典传值查询。可以指定字段,且是字典为非必填。字段有值就查,没有值就不查该字段。 @login_required(login_url="/user/login") def my_earn(request): """ 我的收益,就是主播的流水 :pa continue reading django zhuoyuebiji 2020/4/5 419
How to django admin changlist add myself data code: # admin.py class BindBillAdmin(admin.ModelAdmin): def has_delete_permission(self, request, obj=None): # 编辑页面禁用删除按钮 continue reading django zhuoyuebiji 2020/4/9 282
Django2.2 反向解析 admin 的 url https://docs.djangoproject.com/zh-hans/2.2/ref/contrib/admin/#admin-reverse-urls 代码里使用: from django.urls import reverse print(reverse continue reading django zhuoyuebiji 2020/4/14 291
Django Admin Show Image from Imagefield(Django admin 图片预览) 在 Django 管理后台中,图片字段(ImageField)默认是显示路径,期望能看到图片预览图。 编写 ImageWidgetAdmin 继承 admin.ModelAdmin, 编写自己的 image admin #!/usr/bin continue reading django zhuoyuebiji 2020/4/15 757
Pycharm2019.2 专业版 导入及配置已存在的 Django 项目 添加 Django 项目到 project 区域 打开项目 选择项目 追加到当前窗口 查看 配置 Django 项目 编辑 Congfigrations Congfigrations 点击 +,选 continue reading django zhuoyuebiji 2020/4/17 622
Django DateTimeField 指定日期筛选(How can I filter a date of a DateTimeField in Django) models.py class AnchorBindAgent(models.Model): """ 主播绑定到代理,绑定规则 """ end_time_default = (timezone.now() + timezone.timedelta(d continue reading django zhuoyuebiji 2020/4/23 902
Why you should use the Django admin: 9 tips This writing is inspired by a comment on Reddit concerning my recent post: “The problem is that everyone I speak to seems to think continue reading django zhuoyuebiji 2020/4/23 154
Django runserver log add client(request) ip source: https://code.djangoproject.com/ticket/16301 django source code location ( django 2.2 ): ..\Lib\site-packages\django\core\s continue reading django zhuoyuebiji 2020/5/4 170
Django2.2 + mysql + pymysql: django.db.utils.InternalError: (1366, "Incorrect string value 解决方案 现象: 部分含 emoji 表情的字符无法存入 mysql 前提: 数据库已设置字符格式 utf8mb4 错误信息: 解决方案: django settings.py 配置 DATABASES -> continue reading django zhuoyuebiji 2020/5/7 187
How to Add a Text Filter to Django Admin(筛选条件自定义输入) When creating a new Django Admin page a common conversation between the developer and the support personal might sound like this: Developer: Hey, continue reading django zhuoyuebiji 2020/5/19 151