标签:ken ram rom lap display nbsp model 业务 event
1.models.py
from django.db import models class UserInfo(models.Model): user_type_choices = ( (1,‘普通用户‘), (2,‘VIP‘), (3,‘SVIP‘), ) user_type = models.IntegerField(choices=user_type_choices) # username = models.CharField(max_length=32) username = models.CharField(max_length=32,unique=True) password = models.CharField(max_length=64) class UserToken(models.Model): user = models.OneToOneField(to=‘UserInfo‘) token = models.CharField(max_length=64)
2.views.py:
假设订单相关业务(只有SVIP用户有权限)
假设用户信息相关业务(只有普通用户、VIP有权限)
2.
3.
4.
5.
标签:ken ram rom lap display nbsp model 业务 event
原文地址:https://www.cnblogs.com/c-x-m/p/8973862.html