-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance restaurant and order management features in admin interface
- Added opening and closing time fields for each day of the week in the Restaurant model and admin. - Updated OrderDetail to include a restaurant foreign key and adjusted related methods for price calculations. - Modified Order model to include a note field and changed the date field to DateTimeField for better tracking. - Enhanced ProductSerializer to calculate final prices including thermopack prices and delivery times. - Improved admin dashboard template by cleaning up unnecessary custom CSS and JS references. These changes improve the management of restaurant operations and enhance the user experience in the admin interface.
- Loading branch information
1 parent
4f328f3
commit d75849e
Showing
10 changed files
with
286 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
api/migrations/0004_remove_restaurant_bussiness_type_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Generated by Django 4.1.1 on 2024-12-11 03:52 | ||
|
||
import datetime | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0003_configuration_business_closing_time_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='restaurant', | ||
name='bussiness_type', | ||
), | ||
migrations.RemoveField( | ||
model_name='restaurant', | ||
name='time', | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='friday_closing_time', | ||
field=models.TimeField(default=datetime.time(23, 59), verbose_name='Friday Closing Time'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='friday_opening_time', | ||
field=models.TimeField(default=datetime.time(8, 0), verbose_name='Friday Opening Time'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='monday_closing_time', | ||
field=models.TimeField(default=datetime.time(23, 59), verbose_name='Monday Closing Time'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='monday_opening_time', | ||
field=models.TimeField(default=datetime.time(8, 0), verbose_name='Monday Opening Time'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='saturday_closing_time', | ||
field=models.TimeField(default=datetime.time(23, 59), verbose_name='Saturday Closing Time'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='saturday_opening_time', | ||
field=models.TimeField(default=datetime.time(8, 0), verbose_name='Saturday Opening Time'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='sunday_closing_time', | ||
field=models.TimeField(default=datetime.time(23, 59), verbose_name='Sunday Closing Time'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='sunday_opening_time', | ||
field=models.TimeField(default=datetime.time(8, 0), verbose_name='Sunday Opening Time'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='thursday_closing_time', | ||
field=models.TimeField(default=datetime.time(23, 59), verbose_name='Thursday Closing Time'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='thursday_opening_time', | ||
field=models.TimeField(default=datetime.time(8, 0), verbose_name='Thursday Opening Time'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='tuesday_closing_time', | ||
field=models.TimeField(default=datetime.time(23, 59), verbose_name='Tuesday Closing Time'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='tuesday_opening_time', | ||
field=models.TimeField(default=datetime.time(8, 0), verbose_name='Tuesday Opening Time'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='wednesday_closing_time', | ||
field=models.TimeField(default=datetime.time(23, 59), verbose_name='Wednesday Closing Time'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='wednesday_opening_time', | ||
field=models.TimeField(default=datetime.time(8, 0), verbose_name='Wednesday Opening Time'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.1.1 on 2024-12-11 03:59 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0004_remove_restaurant_bussiness_type_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='order', | ||
name='note', | ||
field=models.TextField(blank=True, null=True, verbose_name='note'), | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
api/migrations/0006_configuration_delivery_time_restaurant_time.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 4.1.1 on 2024-12-11 04:19 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0005_order_note'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='configuration', | ||
name='delivery_time', | ||
field=models.IntegerField(default=30, verbose_name='delivery time (minutes)'), | ||
), | ||
migrations.AddField( | ||
model_name='restaurant', | ||
name='time', | ||
field=models.IntegerField(default=0, verbose_name='time'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.1.1 on 2024-12-11 04:25 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0006_configuration_delivery_time_restaurant_time'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='product', | ||
name='thermopack_price', | ||
field=models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='thermopack price'), | ||
), | ||
] |
24 changes: 24 additions & 0 deletions
24
api/migrations/0008_orderdetail_restaurant_alter_order_date.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 4.1.1 on 2024-12-11 04:53 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0007_product_thermopack_price'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='orderdetail', | ||
name='restaurant', | ||
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, related_name='order_details', to='api.restaurant'), | ||
), | ||
migrations.AlterField( | ||
model_name='order', | ||
name='date', | ||
field=models.DateTimeField(auto_now_add=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.