创建新工程 添加了一些通用代码和数据库模型

This commit is contained in:
virusdefender
2015-06-26 15:59:53 +08:00
commit 00052d8e9b
42 changed files with 352 additions and 0 deletions

0
account/__init__.py Normal file
View File

3
account/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

15
account/models.py Normal file
View 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
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

1
account/views.py Normal file
View File

@@ -0,0 +1 @@
from django.shortcuts import render