added a option on course

This commit is contained in:
Prince Kurt Laurence 2024-01-24 22:38:59 +08:00
parent 4a9c81fd34
commit 2d75066884
7 changed files with 15 additions and 14 deletions

View file

@ -22,6 +22,7 @@ class CustomUser(AbstractUser):
('BS Food Technology', 'BS Food Technology'), ('BS Food Technology', 'BS Food Technology'),
('BS Applied Physics', 'BS Applied Physics'), ('BS Applied Physics', 'BS Applied Physics'),
('BS Environmental Science', 'BS Environmental Science'), ('BS Environmental Science', 'BS Environmental Science'),
('Not Applicable', 'Not Applicable'),
) )
course = models.CharField( course = models.CharField(

View file

@ -54,7 +54,7 @@ class EquipmentInstance(models.Model):
return super().save(*args, **kwargs) return super().save(*args, **kwargs)
seed_database = False seed_database = True
@receiver(post_migrate) @receiver(post_migrate)

View file

@ -1211,8 +1211,8 @@ components:
email: email:
type: string type: string
format: email format: email
readOnly: true
title: Email address title: Email address
maxLength: 254
first_name: first_name:
type: string type: string
maxLength: 100 maxLength: 100
@ -1220,22 +1220,29 @@ components:
nullable: true nullable: true
oneOf: oneOf:
- $ref: '#/components/schemas/CourseEnum' - $ref: '#/components/schemas/CourseEnum'
- $ref: '#/components/schemas/BlankEnum'
- $ref: '#/components/schemas/NullEnum' - $ref: '#/components/schemas/NullEnum'
section: section:
type: string type: string
nullable: true nullable: true
maxLength: 60
last_name: last_name:
type: string type: string
maxLength: 100 maxLength: 100
is_teacher: is_teacher:
type: boolean type: boolean
readOnly: true
is_technician: is_technician:
type: boolean type: boolean
readOnly: true
required: required:
- course
- email
- first_name - first_name
- id - id
- is_teacher
- is_technician
- last_name - last_name
- section
- username - username
Equipment: Equipment:
type: object type: object
@ -1486,8 +1493,8 @@ components:
email: email:
type: string type: string
format: email format: email
readOnly: true
title: Email address title: Email address
maxLength: 254
first_name: first_name:
type: string type: string
maxLength: 100 maxLength: 100
@ -1495,18 +1502,20 @@ components:
nullable: true nullable: true
oneOf: oneOf:
- $ref: '#/components/schemas/CourseEnum' - $ref: '#/components/schemas/CourseEnum'
- $ref: '#/components/schemas/BlankEnum'
- $ref: '#/components/schemas/NullEnum' - $ref: '#/components/schemas/NullEnum'
section: section:
type: string type: string
nullable: true nullable: true
maxLength: 60
last_name: last_name:
type: string type: string
maxLength: 100 maxLength: 100
is_teacher: is_teacher:
type: boolean type: boolean
readOnly: true
is_technician: is_technician:
type: boolean type: boolean
readOnly: true
PatchedEquipment: PatchedEquipment:
type: object type: object
properties: properties:
@ -1589,8 +1598,6 @@ components:
type: string type: string
format: date-time format: date-time
readOnly: true readOnly: true
section:
type: string
SendEmailReset: SendEmailReset:
type: object type: object
properties: properties:
@ -1707,13 +1714,10 @@ components:
type: string type: string
format: date-time format: date-time
readOnly: true readOnly: true
section:
type: string
required: required:
- borrower - borrower
- equipments - equipments
- id - id
- section
- subject - subject
- teacher - teacher
- timestamp - timestamp
@ -1743,10 +1747,6 @@ components:
properties: properties:
username: username:
type: string type: string
description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_
only.
pattern: ^[\w.@+-]+$
maxLength: 150
email: email:
type: string type: string
format: email format: email