创建新工程 添加了一些通用代码和数据库模型
This commit is contained in:
0
account/__init__.py
Normal file
0
account/__init__.py
Normal file
3
account/admin.py
Normal file
3
account/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
0
account/migrations/__init__.py
Normal file
0
account/migrations/__init__.py
Normal file
15
account/models.py
Normal file
15
account/models.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# coding=utf-8
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import AbstractBaseUser
|
||||
|
||||
|
||||
class AdminGroup(models.Model):
|
||||
pass
|
||||
|
||||
|
||||
class User(AbstractBaseUser):
|
||||
username = models.CharField(max_length=30, unique=True)
|
||||
admin_group = models.ForeignKey(AdminGroup, null=True, on_delete=models.SET_NULL)
|
||||
|
||||
class Meta:
|
||||
db_table = "user"
|
||||
3
account/tests.py
Normal file
3
account/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
1
account/views.py
Normal file
1
account/views.py
Normal file
@@ -0,0 +1 @@
|
||||
from django.shortcuts import render
|
||||
Reference in New Issue
Block a user