摘要:
1 class Boy(models.Model): 2 name = models.CharField(max_length=32) 3 4 class Girl(models.Model): 5 nick = models.CharField(max_length=32) 6 7 class L 阅读全文
posted @ 2020-05-31 23:14
高汤
阅读(1607)
评论(0)
推荐(0)
摘要:
1 # 普通查询 2 q = models.UserInfo.objects.all() 3 for row in q: 4 print(row.name, row.ut.title) # 每次循环时都会去连表查询 5 6 7 # select_related: 查询主动做连表 适合表数据不是特别大 阅读全文
posted @ 2020-05-31 22:00
高汤
阅读(213)
评论(0)
推荐(0)
摘要:
1 def login(request): 2 if request.method == 'GET': 3 return render(request, 'login.html') 4 5 user = request.POST.get('user') 6 pwd = request.POST.ge 阅读全文
posted @ 2020-05-31 14:35
高汤
阅读(441)
评论(0)
推荐(0)
摘要:
1 from django.utils.deprecation import MiddlewareMixin 2 from django.shortcuts import redirect, HttpResponse 3 import re 4 class RbacMiddleware(Middle 阅读全文
posted @ 2020-05-31 14:31
高汤
阅读(596)
评论(0)
推荐(0)
摘要:
1 from django.db import models 2 3 # Create your models here. 4 5 class Permission(models.Model): 6 ''' 7 权限表 8 ''' 9 title = models.CharField(verbose 阅读全文
posted @ 2020-05-31 14:21
高汤
阅读(227)
评论(0)
推荐(0)

浙公网安备 33010602011771号