Commit 0c1463bc authored by ibuler's avatar ibuler

[Update] 修改支持工单

parent cf719f49
...@@ -4,6 +4,8 @@ from django.utils.translation import ugettext_lazy as _ ...@@ -4,6 +4,8 @@ from django.utils.translation import ugettext_lazy as _
from rest_framework.authtoken.models import Token from rest_framework.authtoken.models import Token
from django.conf import settings from django.conf import settings
from common.mixins.models import CommonModelMixin
class AccessKey(models.Model): class AccessKey(models.Model):
id = models.UUIDField(verbose_name='AccessKeyID', primary_key=True, id = models.UUIDField(verbose_name='AccessKeyID', primary_key=True,
...@@ -33,3 +35,10 @@ class PrivateToken(Token): ...@@ -33,3 +35,10 @@ class PrivateToken(Token):
class Meta: 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"))
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class OrdersConfig(AppConfig):
name = 'orders'
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)
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment