上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 22 下一页
# admin.py class InnerOrderAdmin(admin.ModelAdmin): ... # 外键关联下拉框 筛选 def formfield_for_foreignkey(self, db_field, request, **kwargs): if db_field.name Read More
posted @ 2022-10-06 14:34 PythonNew_Mr.Wang Views(276) Comments(0) Diggs(0) Edit
### models.py的配置 ```python # user是存放在media里面的指定路径文件夹下的,file是给这个字段存放的文件夹的 file = models.FileField(upload_to="user/file",verbose_name="下载资料",blank=True, Read More
posted @ 2022-09-28 17:16 PythonNew_Mr.Wang Views(233) Comments(0) Diggs(0) Edit
# 保存后 重定向跳转 def change_view(self, request, object_id, form_url='', extra_context=None): result_template = super().change_view(request, object_id, form Read More
posted @ 2022-09-23 17:28 PythonNew_Mr.Wang Views(69) Comments(0) Diggs(0) Edit
```python import numpy as np def dict_to_dicts(origin: dict, n: int): """ :param origin: 被拆封的字典 :param n: 被拆分几个 :return: 返回列表包字典 """ n -= 1 keys = lis Read More
posted @ 2022-09-14 13:20 PythonNew_Mr.Wang Views(444) Comments(0) Diggs(0) Edit
1:构建一个接口 import uvicorn from fastapi import FastAPI app = FastAPI() """ 构建接口 """ @app.get("/") async def Index(): return {"code":200,"msg":"访问成功"} if Read More
posted @ 2022-09-13 12:35 PythonNew_Mr.Wang Views(419) Comments(0) Diggs(0) Edit
1:目录结构 2:配置sqlalchemy参数文件 : config.py # config.py from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sq Read More
posted @ 2022-09-13 02:37 PythonNew_Mr.Wang Views(355) Comments(0) Diggs(0) Edit
1:基础理解异步如何实现的 # 请记住async创建的对象一定是coroutine对象 async def func(name): res = random.randint(1,10) print("{}需要{}秒".format(name,res)) # await 后面一定是coroutine对 Read More
posted @ 2022-09-09 16:33 PythonNew_Mr.Wang Views(141) Comments(0) Diggs(0) Edit
1:继承后台首页的模板,找到需要修改的部分。 文件位置: templates/admin/home.html {% block 你的继承负名 %} <el-card style="margin-top: 10px;"> <iframe style="width: 100%;height: 410px Read More
posted @ 2022-07-26 20:29 PythonNew_Mr.Wang Views(233) Comments(0) Diggs(0) Edit
```python from selenium.webdriver.common.action_chains import ActionChains from selenium import webdriver from PIL import Image web = webdriver.Chrome Read More
posted @ 2022-07-20 15:05 PythonNew_Mr.Wang Views(600) Comments(0) Diggs(0) Edit
UPDATE "main"."auth_permission" SET "content_type_id" = 1, "name" = 'Can add 日志记录' WHERE "codename" = 'add_logentry'; UPDATE "main"."auth_permission" Read More
posted @ 2022-07-18 00:44 PythonNew_Mr.Wang Views(50) Comments(0) Diggs(0) Edit
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 22 下一页