setup update 3
This commit is contained in:
+27
-41
@@ -1,58 +1,44 @@
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import StringField, IntegerField, SelectField, TextAreaField, SubmitField
|
||||
from wtforms.validators import DataRequired, NumberRange, Length, Optional
|
||||
from wtforms import StringField, IntegerField, TextAreaField, BooleanField, SubmitField, SelectField
|
||||
from wtforms.validators import DataRequired, Length, NumberRange, Optional
|
||||
|
||||
class ClassroomForm(FlaskForm):
|
||||
code = StringField('Classroom Code', validators=[
|
||||
DataRequired(),
|
||||
Length(min=2, max=20, message='Code must be between 2 and 20 characters')
|
||||
])
|
||||
name = StringField('Classroom Name', validators=[
|
||||
DataRequired(),
|
||||
Length(max=100)
|
||||
])
|
||||
# campus_id = SelectField('Campus', coerce=int, validators=[DataRequired()])
|
||||
building = StringField('Building', validators=[
|
||||
DataRequired(),
|
||||
Length(max=50)
|
||||
Length(min=2, max=100)
|
||||
])
|
||||
room_number = StringField('Room Number', validators=[
|
||||
DataRequired(),
|
||||
Length(min=1, max=50)
|
||||
])
|
||||
floor = IntegerField('Floor', validators=[
|
||||
DataRequired(),
|
||||
NumberRange(min=1, max=10)
|
||||
NumberRange(min=1, max=50)
|
||||
])
|
||||
capacity = IntegerField('Capacity', validators=[
|
||||
DataRequired(),
|
||||
NumberRange(min=1, max=200)
|
||||
NumberRange(min=1, max=500)
|
||||
])
|
||||
description = TextAreaField('Description', validators=[Optional(), Length(max=500)])
|
||||
campus_location = SelectField('Campus Location',
|
||||
choices=[
|
||||
('Main Campus', 'Main Campus'),
|
||||
('North Campus', 'North Campus'),
|
||||
('Science & Technology Campus', 'Science & Technology Campus'),
|
||||
('Downtown Campus', 'Downtown Campus')
|
||||
],
|
||||
validators=[DataRequired()])
|
||||
description = TextAreaField('Description', validators=[
|
||||
Optional(),
|
||||
Length(max=500)
|
||||
])
|
||||
is_active = BooleanField('Active', default=True)
|
||||
submit = SubmitField('Save Classroom')
|
||||
|
||||
class ClassroomResourceForm(FlaskForm):
|
||||
resource_type = SelectField('Resource Type',
|
||||
choices=[
|
||||
('PROJECTOR', 'Projector'),
|
||||
('WHITEBOARD', 'Whiteboard'),
|
||||
('SMART_BOARD', 'Smart Board'),
|
||||
('SCREEN', 'Screen'),
|
||||
('AUDIO_SYSTEM', 'Audio System'),
|
||||
('COMPUTERS', 'Computers'),
|
||||
('LAB_EQUIPMENT', 'Lab Equipment'),
|
||||
('AIR_CONDITIONING', 'Air Conditioning'),
|
||||
('HEATING', 'Heating')
|
||||
],
|
||||
validators=[DataRequired()])
|
||||
resource_type = SelectField('Resource Type', choices=[
|
||||
('PROJECTOR', 'Projector'),
|
||||
('WHITEBOARD', 'Whiteboard'),
|
||||
('COMPUTER', 'Computer'),
|
||||
('SOUND_SYSTEM', 'Sound System'),
|
||||
('MICROPHONE', 'Microphone'),
|
||||
('AIR_CONDITIONER', 'Air Conditioner'),
|
||||
('OTHER', 'Other')
|
||||
], validators=[DataRequired()])
|
||||
brand = StringField('Brand', validators=[Optional(), Length(max=100)])
|
||||
model = StringField('Model', validators=[Optional(), Length(max=100)])
|
||||
specifications = TextAreaField('Specifications', validators=[Optional(), Length(max=1000)])
|
||||
quantity = IntegerField('Quantity', validators=[
|
||||
DataRequired(),
|
||||
NumberRange(min=1, max=50)
|
||||
], default=1)
|
||||
submit = SubmitField('Add Resource')
|
||||
specifications = TextAreaField('Specifications', validators=[Optional()])
|
||||
functional = BooleanField('Functional', default=True)
|
||||
submit = SubmitField('Save Resource')
|
||||
Reference in New Issue
Block a user