feat: 添加行政管理App
This commit is contained in:
parent
b0df18f01a
commit
cb09cee753
|
@ -0,0 +1,3 @@
|
||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
|
@ -0,0 +1,6 @@
|
||||||
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
|
class OfmConfig(AppConfig):
|
||||||
|
default_auto_field = 'django.db.models.BigAutoField'
|
||||||
|
name = 'apps.ofm'
|
|
@ -0,0 +1,25 @@
|
||||||
|
from django.db import models
|
||||||
|
from apps.utils.models import CommonADModel, BaseModel
|
||||||
|
# Create your models here.
|
||||||
|
|
||||||
|
class Mroom(CommonADModel):
|
||||||
|
"""TN: 会议室基本信息"""
|
||||||
|
name = models.CharField('会议室名称', max_length=50, unique=True)
|
||||||
|
location = models.CharField('位置', max_length=100)
|
||||||
|
capacity = models.PositiveIntegerField('容纳人数')
|
||||||
|
|
||||||
|
class MroomBooking(CommonADModel):
|
||||||
|
"""TN: 会议室预定信息"""
|
||||||
|
title = models.CharField('会议主题', max_length=100)
|
||||||
|
|
||||||
|
|
||||||
|
class MroomSlot(BaseModel):
|
||||||
|
"""TN: 会议室时段"""
|
||||||
|
mroom = models.ForeignKey(Mroom, on_delete=models.CASCADE)
|
||||||
|
booking = models.ForeignKey(MroomBooking, on_delete=models.CASCADE)
|
||||||
|
mdate = models.DateField('会议日期', db_index=True)
|
||||||
|
slot = models.PositiveIntegerField('时段', help_text='0-47')
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
unique_together = ('mroom', 'mdate', 'slot')
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
# Create your tests here.
|
|
@ -0,0 +1,4 @@
|
||||||
|
from django.shortcuts import render
|
||||||
|
from apps.utils.viewsets import CustomModelViewSet
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue