创建新工程 添加了一些通用代码和数据库模型
This commit is contained in:
0
problem/__init__.py
Normal file
0
problem/__init__.py
Normal file
3
problem/admin.py
Normal file
3
problem/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
0
problem/migrations/__init__.py
Normal file
0
problem/migrations/__init__.py
Normal file
19
problem/models.py
Normal file
19
problem/models.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# coding=utf-8
|
||||
from django.db import models
|
||||
|
||||
from account.models import User
|
||||
|
||||
|
||||
class AbstractProblem(models.Model):
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
|
||||
class Problem(AbstractProblem):
|
||||
pass
|
||||
|
||||
|
||||
class Solution(models.Model):
|
||||
user = models.ForeignKey(User)
|
||||
problem = models.ForeignKey(Problem)
|
||||
3
problem/tests.py
Normal file
3
problem/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
3
problem/views.py
Normal file
3
problem/views.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Reference in New Issue
Block a user