feat: 添加行政管理App

This commit is contained in:
caoqianming 2025-06-24 08:47:22 +08:00
parent b0df18f01a
commit cb09cee753
7 changed files with 41 additions and 0 deletions

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

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

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

6
apps/ofm/apps.py Normal file
View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class OfmConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'apps.ofm'

View File

25
apps/ofm/models.py Normal file
View File

@ -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')

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

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

4
apps/ofm/views.py Normal file
View File

@ -0,0 +1,4 @@
from django.shortcuts import render
from apps.utils.viewsets import CustomModelViewSet