上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 22 下一页
该文被密码保护。 Read More
posted @ 2022-12-07 16:56 PythonNew_Mr.Wang Views(3415) Comments(0) Diggs(0)
该文被密码保护。 Read More
posted @ 2022-12-07 14:44 PythonNew_Mr.Wang Views(2015) Comments(0) Diggs(0)
该文被密码保护。 Read More
posted @ 2022-12-07 13:03 PythonNew_Mr.Wang Views(2207) Comments(0) Diggs(0)
```python import datetime # 当前日期 def today_date(): return datetime.datetime.now().date() # 上周一 def last_monday(): return str(datetime.datetime.now() - Read More
posted @ 2022-11-19 13:53 PythonNew_Mr.Wang Views(377) Comments(0) Diggs(0)
多对多字段: technology_user = fields.ManyToManyField(to="custom_auth.AdminUser",verbose_name="技术",blank=True,null=True) 放到list_display显示即可 # 多对多字段显示 def te Read More
posted @ 2022-11-18 18:01 PythonNew_Mr.Wang Views(280) Comments(0) Diggs(0)
# 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(383) Comments(0) Diggs(0)
### 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(287) Comments(0) Diggs(0)
# 保存后 重定向跳转 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(84) Comments(0) Diggs(0)
```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(466) Comments(0) Diggs(0)
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(497) Comments(0) Diggs(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 22 下一页