[Update] 修改支持工单

pull/3428/head
ibuler 2019-10-25 11:27:50 +08:00
parent cf719f492d
commit 0c1463bc8b
8 changed files with 47 additions and 1 deletions

View File

@ -4,6 +4,8 @@ from django.utils.translation import ugettext_lazy as _
from rest_framework.authtoken.models import Token
from django.conf import settings
from common.mixins.models import CommonModelMixin
class AccessKey(models.Model):
id = models.UUIDField(verbose_name='AccessKeyID', primary_key=True,
@ -32,4 +34,11 @@ class PrivateToken(Token):
"""Inherit from auth token, otherwise migration is boring"""
class Meta:
verbose_name = _('Private Token')
verbose_name = _('Private Token')
class LoginConfirmSetting(CommonModelMixin):
user = models.OneToOneField('users.User', on_delete=models.CASCADE, verbose_name=_("User"), related_name=_("login_confirmation_setting"))
reviewers = models.ManyToManyField('users.User', verbose_name=_("Reviewers"), related_name=_("review_login_confirmation_settings"))
is_active = models.BooleanField(default=True, verbose_name=_("Is active"))

0
apps/orders/__init__.py Normal file
View File

3
apps/orders/admin.py Normal file
View File

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

5
apps/orders/apps.py Normal file
View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class OrdersConfig(AppConfig):
name = 'orders'

View File

23
apps/orders/models.py Normal file
View File

@ -0,0 +1,23 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _
from common.mixins.models import CommonModelMixin
class Order(CommonModelMixin):
STATUS_CHOICES = (
('accepted', _("Accepted")),
('rejected', _("Rejected")),
('pending', _("Pending"))
)
TYPE_CHOICES = (
('login_request', _("Login request")),
)
requester = models.ForeignKey('users.User', on_delete=models.SET_NULL, null=True, related_name='orders')
user_name = models.CharField(max_length=128, verbose_name=_("User"))
title = models.CharField(max_length=256, verbose_name=_("Title"))
body = models.TextField(verbose_name=_("Body"))
type = models.CharField(choices=TYPE_CHOICES, max_length=64)
status = models.CharField(choices=STATUS_CHOICES, max_length=16)

3
apps/orders/tests.py Normal file
View File

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

3
apps/orders/views.py Normal file
View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.