Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/hmweb-main' into hmweb-test
Browse files Browse the repository at this point in the history
  • Loading branch information
anujpatel03 committed Apr 10, 2024
2 parents 0530655 + ede22a4 commit cc4a3c3
Show file tree
Hide file tree
Showing 15 changed files with 550 additions and 182 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 3.1.5 on 2024-04-09 20:09

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('academic_information', '0001_initial'),
]

operations = [
migrations.RemoveField(
model_name='student',
name='hall_no',
),
migrations.AddField(
model_name='student',
name='hall_id',
field=models.CharField(blank=True, max_length=10, null=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 3.1.5 on 2024-04-09 20:14

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('academic_information', '0002_auto_20240409_2009'),
]

operations = [
migrations.RemoveField(
model_name='student',
name='hall_id',
),
migrations.AddField(
model_name='student',
name='hall_no',
field=models.IntegerField(default=0),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 3.1.5 on 2024-03-19 23:39

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('globals', '0020_auto_20240315_2158'),
('globals', '0018_auto_20240315_2157'),
]

operations = [
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.1.5 on 2024-04-09 20:09

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('globals', '0021_merge_20240319_2339'),
]

operations = [
migrations.AlterField(
model_name='extrainfo',
name='user_status',
field=models.CharField(choices=[('NEW', 'NEW'), ('PRESENT', 'PRESENT')], default='PRESENT', max_length=50),
),
]
Binary file modified FusionIIIT/applications/hostel_management/.DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion FusionIIIT/applications/hostel_management/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ class Meta:
'arrival_time',
'departure_date',
'departure_time',
'nationality'
'nationality',
'room_type'
)
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.1.5 on 2024-04-09 15:13

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('hostel_management', '0019_merge_20240315_2153'),
]

operations = [
migrations.AddField(
model_name='guestroom',
name='room_type',
field=models.CharField(choices=[('single', 'Single'), ('double', 'Double'), ('triple', 'Triple')], default='single', max_length=10),
),
migrations.AddField(
model_name='guestroombooking',
name='room_type',
field=models.CharField(choices=[('single', 'Single'), ('double', 'Double'), ('triple', 'Triple')], default='single', max_length=10),
),
]
15 changes: 14 additions & 1 deletion FusionIIIT/applications/hostel_management/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ class GuestRoomBooking(models.Model):
status = models.CharField(max_length=255, choices=HostelManagementConstants.BOOKING_STATUS ,default ="Pending")
booking_date = models.DateField(auto_now_add=False, auto_now=False, default=timezone.now)
nationality = models.CharField(max_length=255, blank=True)
ROOM_TYPES = [
('single', 'Single'),
('double', 'Double'),
('triple', 'Triple'),
# Add more room types as needed
]
room_type = models.CharField(max_length=10, choices=ROOM_TYPES ,default='single')

def __str__(self):
return '%s ----> %s - %s' % (self.id, self.guest_name, self.status)
Expand All @@ -141,7 +148,7 @@ class StaffSchedule(models.Model):
'start_time' stores the start time of a schedule.
'end_time' stores the end time of a schedule.
"""
hall = models.ForeignKey(Hall, on_delete=models.CASCADE)
hall = models.ForeignKey(Hall, on_delete=models.CASCADE)
staff_id = models.ForeignKey(Staff, on_delete=models.CASCADE)
staff_type = models.CharField(max_length=100, default='Caretaker')
day = models.CharField(max_length=15, choices=HostelManagementConstants.DAYS_OF_WEEK)
Expand Down Expand Up @@ -309,10 +316,16 @@ class GuestRoom(models.Model):
'vacant' boolean value to determine if the room is vacant
'occupied_till', date field that tells the next time the room will be vacant, null if 'vacant' == True
"""
ROOM_TYPES = [
('single', 'Single'),
('double', 'Double'),
('triple', 'Triple'),
]
hall = models.ForeignKey(Hall, on_delete=models.CASCADE)
room = models.CharField(max_length=255)
occupied_till = models.DateField(null=True, blank=True)
vacant = models.BooleanField(default=True)
room_type = models.CharField(max_length=10, choices=ROOM_TYPES ,default='single')
@property
def _vacant(self) -> bool:
if self.occupied_till and self.occupied_till > timezone.now():
Expand Down
5 changes: 5 additions & 0 deletions FusionIIIT/applications/hostel_management/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
#guest room
path('book_guest_room/', views.request_guest_room, name="book_guest_room"),
path('update_guest_room/', views.update_guest_room, name="update_guest_room"),
path('available_guest_rooms/', views.available_guestrooms_api, name='available_guestrooms_api'),


# !!todo: Add Fine Functionality
Expand All @@ -107,5 +108,9 @@

path('student/<str:username>/name/', views.get_student_name, name='find_name'),


path('edit-student/<int:student_id>/', views.edit_student, name='edit_student'),



]
Loading

0 comments on commit cc4a3c3

Please sign in to comment.