06 2022 档案

摘要:# admin.py import datetime import random import time from django.contrib import admin, messages # Register your models here. from django.db.models imp 阅读全文
posted @ 2022-06-30 00:37 PythonNew_Mr.Wang 阅读(2216) 评论(0) 推荐(0) 编辑
摘要:# 判断 动态返回显示字段 self.list_display = ('name', 'head_picture', 'sex', 'interest', 'is_staff', 'age', 'score_custom', 'time', 'date') def get_list_display( 阅读全文
posted @ 2022-06-30 00:28 PythonNew_Mr.Wang 阅读(156) 评论(0) 推荐(0) 编辑
摘要:# admin.py 返回图片 # Admin自定义返回列表PRO 例子:照片邮箱 def head_picture(self,models_obj): return format_html('<img src="{}" height="50" width="50">', '{}'.format(m 阅读全文
posted @ 2022-06-29 12:43 PythonNew_Mr.Wang 阅读(183) 评论(0) 推荐(0) 编辑
摘要:# settings.py INSTALLED_APPS = [ 'import_export', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessio 阅读全文
posted @ 2022-06-28 23:24 PythonNew_Mr.Wang 阅读(1101) 评论(0) 推荐(0) 编辑
摘要:# Admin.py def get_queryset(self, request): """ 重写默认查询方法,可以用于数据权限控制 :param request.user: 当前登录用户名 :param request.user.id: 当前登录用户ID :param request.user. 阅读全文
posted @ 2022-06-27 21:25 PythonNew_Mr.Wang 阅读(88) 评论(0) 推荐(0) 编辑
摘要:import random def split_int(amount,num): """ :param amount: 拆分的数字 54782 :param num: 拆分成几组 4 :return: 拆分后得到的数组 [11001, 6085, 9494, 28202] """ list1 = [ 阅读全文
posted @ 2022-06-17 14:40 PythonNew_Mr.Wang 阅读(661) 评论(0) 推荐(0) 编辑
摘要:public class Cont { public static void main(String[] args) { // 只能使用 不能更改 System.out.printf("常量" + Constant.AGE); System.out.printf("NAME" + Constant. 阅读全文
posted @ 2022-06-06 18:17 PythonNew_Mr.Wang 阅读(35) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示