上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页
# admin.py import datetime import random import time from django.contrib import admin, messages # Register your models here. from django.db.models imp Read More
posted @ 2022-06-30 00:37 PythonNew_Mr.Wang Views(2342) Comments(0) Diggs(0)
# 判断 动态返回显示字段 self.list_display = ('name', 'head_picture', 'sex', 'interest', 'is_staff', 'age', 'score_custom', 'time', 'date') def get_list_display( Read More
posted @ 2022-06-30 00:28 PythonNew_Mr.Wang Views(163) Comments(0) Diggs(0)
# admin.py 返回图片 # Admin自定义返回列表PRO 例子:照片邮箱 def head_picture(self,models_obj): return format_html('<img src="{}" height="50" width="50">', '{}'.format(m Read More
posted @ 2022-06-29 12:43 PythonNew_Mr.Wang Views(194) Comments(0) Diggs(0)
# settings.py INSTALLED_APPS = [ 'import_export', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessio Read More
posted @ 2022-06-28 23:24 PythonNew_Mr.Wang Views(1138) Comments(0) Diggs(0)
# Admin.py def get_queryset(self, request): """ 重写默认查询方法,可以用于数据权限控制 :param request.user: 当前登录用户名 :param request.user.id: 当前登录用户ID :param request.user. Read More
posted @ 2022-06-27 21:25 PythonNew_Mr.Wang Views(100) Comments(0) Diggs(0)
import random def split_int(amount,num): """ :param amount: 拆分的数字 54782 :param num: 拆分成几组 4 :return: 拆分后得到的数组 [11001, 6085, 9494, 28202] """ list1 = [ Read More
posted @ 2022-06-17 14:40 PythonNew_Mr.Wang Views(676) Comments(0) Diggs(0)
public class Cont { public static void main(String[] args) { // 只能使用 不能更改 System.out.printf("常量" + Constant.AGE); System.out.printf("NAME" + Constant. Read More
posted @ 2022-06-06 18:17 PythonNew_Mr.Wang Views(39) Comments(0) Diggs(0)
def random_code_six(): """ :return 58yWNl """ str = "" for i in range(6): code = random.randrange(3) if code == 0: ch = chr(random.randrange(ord("A"), Read More
posted @ 2022-05-25 14:04 PythonNew_Mr.Wang Views(48) Comments(0) Diggs(0)
# 输入字符串 返回加密数据 def md5_func(parameters): """ :USE: Encryption Data :param: String :return 9cd6afb07d85b28ead0cecd99c317158 """ ctime = str(time.time() Read More
posted @ 2022-05-25 14:02 PythonNew_Mr.Wang Views(88) Comments(0) Diggs(0)
# 设置 不可编辑项 def get_readonly_fields(self, request, obj=None): # 判断是否是超级管理员 if request.user.is_superuser: self.readonly_fields = [] else: self.readonly_ Read More
posted @ 2022-05-12 16:49 PythonNew_Mr.Wang Views(297) Comments(0) Diggs(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页