├── Distributed Systems.pdf ├── db01 ├── api │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── admin.cpython-36.pyc │ │ ├── models.cpython-36.pyc │ │ ├── serializers.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── views.cpython-36.pyc │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_auto_20190311_0945.py │ │ ├── 0003_auto_20190311_1047.py │ │ ├── 0004_user_activated.py │ │ ├── 0005_busservice.py │ │ ├── 0006_remove_busservice_provider.py │ │ ├── 0007_auto_20190318_1410.py │ │ ├── 0008_auto_20190318_1412.py │ │ ├── 0009_busservice_provider.py │ │ ├── 0010_busservice_seats.py │ │ ├── 0011_hotelservice.py │ │ ├── 0012_auto_20190321_2126.py │ │ ├── 0013_hotelservice_address.py │ │ ├── 0014_auto_20190407_1346.py │ │ ├── 0015_auto_20190407_1356.py │ │ ├── 0016_hotelbooking.py │ │ ├── 0017_auto_20190408_1937.py │ │ ├── 0018_auto_20190408_2034.py │ │ ├── 0019_hotelbooking_booking_date.py │ │ ├── 0020_auto_20190409_0650.py │ │ ├── 0021_auto_20190411_2117.py │ │ ├── 0022_hotelbooking_rooms.py │ │ ├── 0023_hotelbooking_bill.py │ │ ├── 0024_hotelservice_description.py │ │ ├── 0025_auto_20190424_1634.py │ │ ├── 0026_busbooking.py │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── 0001_initial.cpython-36.pyc │ │ │ ├── 0002_auto_20190311_0945.cpython-36.pyc │ │ │ ├── 0003_auto_20190311_1047.cpython-36.pyc │ │ │ ├── 0004_user_activated.cpython-36.pyc │ │ │ ├── 0005_busservice.cpython-36.pyc │ │ │ ├── 0006_remove_busservice_provider.cpython-36.pyc │ │ │ ├── 0007_auto_20190318_1410.cpython-36.pyc │ │ │ ├── 0008_auto_20190318_1412.cpython-36.pyc │ │ │ ├── 0009_busservice_provider.cpython-36.pyc │ │ │ ├── 0010_busservice_seats.cpython-36.pyc │ │ │ ├── 0011_hotelservice.cpython-36.pyc │ │ │ ├── 0012_auto_20190321_2126.cpython-36.pyc │ │ │ ├── 0013_hotelservice_address.cpython-36.pyc │ │ │ ├── 0014_auto_20190407_1346.cpython-36.pyc │ │ │ ├── 0015_auto_20190407_1356.cpython-36.pyc │ │ │ ├── 0016_hotelbooking.cpython-36.pyc │ │ │ ├── 0017_auto_20190408_1937.cpython-36.pyc │ │ │ ├── 0018_auto_20190408_2034.cpython-36.pyc │ │ │ ├── 0019_hotelbooking_booking_date.cpython-36.pyc │ │ │ ├── 0020_auto_20190409_0650.cpython-36.pyc │ │ │ ├── 0021_auto_20190411_2117.cpython-36.pyc │ │ │ ├── 0022_hotelbooking_rooms.cpython-36.pyc │ │ │ ├── 0023_hotelbooking_bill.cpython-36.pyc │ │ │ ├── 0024_hotelservice_description.cpython-36.pyc │ │ │ ├── 0025_auto_20190424_1634.cpython-36.pyc │ │ │ ├── 0026_busbooking.cpython-36.pyc │ │ │ └── __init__.cpython-36.pyc │ ├── models.py │ ├── serializers.py │ ├── tests.py │ ├── urls.py │ └── views.py ├── db01 │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── settings.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── wsgi.cpython-36.pyc │ ├── settings.py │ ├── urls.py │ └── wsgi.py └── manage.py ├── db02 ├── api │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── admin.cpython-36.pyc │ │ ├── models.cpython-36.pyc │ │ ├── serializers.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── views.cpython-36.pyc │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_busbooking.py │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── 0001_initial.cpython-36.pyc │ │ │ ├── 0002_busbooking.cpython-36.pyc │ │ │ └── __init__.cpython-36.pyc │ ├── models.py │ ├── serializers.py │ ├── tests.py │ ├── urls.py │ └── views.py ├── db02 │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── settings.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── wsgi.cpython-36.pyc │ ├── settings.py │ ├── urls.py │ └── wsgi.py └── manage.py ├── db03 ├── api │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── admin.cpython-36.pyc │ │ ├── models.cpython-36.pyc │ │ ├── serializers.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── views.cpython-36.pyc │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_busbooking.py │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── 0001_initial.cpython-36.pyc │ │ │ ├── 0002_busbooking.cpython-36.pyc │ │ │ └── __init__.cpython-36.pyc │ ├── models.py │ ├── serializers.py │ ├── tests.py │ ├── urls.py │ └── views.py ├── db03 │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── settings.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── wsgi.cpython-36.pyc │ ├── settings.py │ ├── urls.py │ └── wsgi.py └── manage.py ├── db04 ├── api │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── admin.cpython-36.pyc │ │ ├── models.cpython-36.pyc │ │ ├── serializers.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── views.cpython-36.pyc │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_busbooking.py │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── 0001_initial.cpython-36.pyc │ │ │ ├── 0002_busbooking.cpython-36.pyc │ │ │ └── __init__.cpython-36.pyc │ ├── models.py │ ├── serializers.py │ ├── tests.py │ ├── urls.py │ └── views.py ├── db04 │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── settings.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── wsgi.cpython-36.pyc │ ├── settings.py │ ├── urls.py │ └── wsgi.py └── manage.py ├── instructions.txt ├── readme.md ├── requirements.txt ├── server ├── accounts │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── admin.cpython-36.pyc │ │ ├── authentication.cpython-36.pyc │ │ ├── forms.cpython-36.pyc │ │ ├── mail.cpython-36.pyc │ │ ├── models.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── views.cpython-36.pyc │ ├── admin.py │ ├── apps.py │ ├── authentication.py │ ├── forms.py │ ├── mail.py │ ├── migrations │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ └── __init__.cpython-36.pyc │ ├── models.py │ ├── templates │ │ └── accounts │ │ │ ├── base.html │ │ │ ├── forgot.html │ │ │ ├── login.html │ │ │ ├── reset.html │ │ │ ├── reset_done.html │ │ │ └── signup.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── booking │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── admin.cpython-36.pyc │ │ ├── forms.cpython-36.pyc │ │ ├── models.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── views.cpython-36.pyc │ ├── admin.py │ ├── apps.py │ ├── forms.py │ ├── migrations │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ └── __init__.cpython-36.pyc │ ├── models.py │ ├── templates │ │ └── booking │ │ │ ├── details.html │ │ │ ├── details_bus.html │ │ │ ├── past_buses.html │ │ │ ├── past_hotels.html │ │ │ ├── upcoming_buses.html │ │ │ └── upcoming_hotels.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── buses │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── admin.cpython-36.pyc │ │ ├── forms.cpython-36.pyc │ │ ├── models.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── views.cpython-36.pyc │ ├── admin.py │ ├── apps.py │ ├── forms.py │ ├── migrations │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ └── __init__.cpython-36.pyc │ ├── models.py │ ├── templates │ │ └── buses │ │ │ ├── bookings.html │ │ │ ├── details.html │ │ │ ├── display.html │ │ │ └── search.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── database │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── admin.cpython-36.pyc │ │ ├── models.cpython-36.pyc │ │ └── utils.cpython-36.pyc │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── 0002_remove_servicemetadata_capacity.py │ │ ├── 0003_servicemetadata_capacity.py │ │ ├── 0004_bookingmetadata.py │ │ ├── 0005_databasedetails_status.py │ │ ├── 0006_auto_20190425_0019.py │ │ ├── 0007_auto_20190425_1006.py │ │ ├── 0008_servicemetadata_db_name_0.py │ │ ├── 0009_auto_20190425_1044.py │ │ ├── 0010_pendingupdates.py │ │ ├── 0011_pendingupdates_timestamp.py │ │ ├── 0012_pendingupdates_db_name.py │ │ ├── 0013_auto_20190426_2159.py │ │ ├── 0014_auto_20190426_2204.py │ │ ├── 0015_auto_20190426_2213.py │ │ ├── 0016_auto_20190426_2226.py │ │ ├── 0017_auto_20190426_2308.py │ │ ├── 0018_usermetadata_db_name_0.py │ │ ├── 0019_auto_20190427_2333.py │ │ ├── 0020_heartbeatrate.py │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── 0001_initial.cpython-36.pyc │ │ │ ├── 0002_remove_servicemetadata_capacity.cpython-36.pyc │ │ │ ├── 0002_usermetadata.cpython-36.pyc │ │ │ ├── 0003_databasedetails.cpython-36.pyc │ │ │ ├── 0003_servicemetadata_capacity.cpython-36.pyc │ │ │ ├── 0004_auto_20190310_0909.cpython-36.pyc │ │ │ ├── 0004_bookingmetadata.cpython-36.pyc │ │ │ ├── 0005_auto_20190310_1012.cpython-36.pyc │ │ │ ├── 0005_databasedetails_status.cpython-36.pyc │ │ │ ├── 0006_auto_20190425_0019.cpython-36.pyc │ │ │ ├── 0006_servicemetadata.cpython-36.pyc │ │ │ ├── 0007_auto_20190425_1006.cpython-36.pyc │ │ │ ├── 0007_servicemetadata_provider.cpython-36.pyc │ │ │ ├── 0008_auto_20190409_0800.cpython-36.pyc │ │ │ ├── 0008_servicemetadata_db_name_0.cpython-36.pyc │ │ │ ├── 0009_auto_20190409_0816.cpython-36.pyc │ │ │ ├── 0009_auto_20190425_1044.cpython-36.pyc │ │ │ ├── 0010_auto_20190409_0859.cpython-36.pyc │ │ │ ├── 0010_pendingupdates.cpython-36.pyc │ │ │ ├── 0011_pendingupdates_timestamp.cpython-36.pyc │ │ │ ├── 0011_remove_servicemetadata_capacity.cpython-36.pyc │ │ │ ├── 0012_pendingupdates_db_name.cpython-36.pyc │ │ │ ├── 0012_servicemetadata_cap.cpython-36.pyc │ │ │ ├── 0013_auto_20190426_2159.cpython-36.pyc │ │ │ ├── 0013_remove_servicemetadata_cap.cpython-36.pyc │ │ │ ├── 0014_auto_20190426_2204.cpython-36.pyc │ │ │ ├── 0014_servicecapacity.cpython-36.pyc │ │ │ ├── 0015_auto_20190409_1823.cpython-36.pyc │ │ │ ├── 0015_auto_20190409_1824.cpython-36.pyc │ │ │ ├── 0015_auto_20190409_1825.cpython-36.pyc │ │ │ ├── 0015_auto_20190426_2213.cpython-36.pyc │ │ │ ├── 0015_delete_servicecapacity.cpython-36.pyc │ │ │ ├── 0016_auto_20190426_2226.cpython-36.pyc │ │ │ ├── 0016_delete_hotelbookingmetadata.cpython-36.pyc │ │ │ ├── 0017_auto_20190426_2308.cpython-36.pyc │ │ │ ├── 0018_usermetadata_db_name_0.cpython-36.pyc │ │ │ ├── 0019_auto_20190427_2333.cpython-36.pyc │ │ │ ├── 0020_heartbeatrate.cpython-36.pyc │ │ │ └── __init__.cpython-36.pyc │ ├── models.py │ ├── tests.py │ ├── utils.py │ └── views.py ├── hotels │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── admin.cpython-36.pyc │ │ ├── forms.cpython-36.pyc │ │ ├── models.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── views.cpython-36.pyc │ ├── admin.py │ ├── apps.py │ ├── forms.py │ ├── migrations │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ └── __init__.cpython-36.pyc │ ├── models.py │ ├── templates │ │ └── hotels │ │ │ ├── bookings.html │ │ │ ├── details.html │ │ │ ├── display.html │ │ │ └── search.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── manage.py ├── person │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── admin.cpython-36.pyc │ │ ├── forms.cpython-36.pyc │ │ ├── models.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── views.cpython-36.pyc │ ├── admin.py │ ├── apps.py │ ├── forms.py │ ├── migrations │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ └── __init__.cpython-36.pyc │ ├── models.py │ ├── templates │ │ └── person │ │ │ ├── admin.html │ │ │ ├── bus_service_edit.html │ │ │ ├── dashboard.html │ │ │ ├── hotel_service_edit.html │ │ │ └── services.html │ ├── tests.py │ ├── urls.py │ └── views.py ├── server │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── settings.cpython-36.pyc │ │ ├── urls.cpython-36.pyc │ │ └── wsgi.cpython-36.pyc │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── static │ └── css │ │ └── bulma.css └── templates │ └── base.html └── snapshots ├── Admin.png ├── Dashboard.png ├── Details.png ├── Manage_Service.png ├── New_Service.png ├── Search_Hotels.png ├── Search_Results.png └── Upcoming.png /Distributed Systems.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/Distributed Systems.pdf -------------------------------------------------------------------------------- /db01/api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/__init__.py -------------------------------------------------------------------------------- /db01/api/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/__pycache__/serializers.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/__pycache__/serializers.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from . import models 3 | 4 | class UserAdmin(admin.ModelAdmin): 5 | readonly_fields = ('password', 'token', 'email', ) 6 | 7 | admin.site.register(models.User) 8 | admin.site.register(models.BusService) 9 | admin.site.register(models.HotelService) 10 | admin.site.register(models.HotelBooking) 11 | admin.site.register(models.BusBooking) 12 | -------------------------------------------------------------------------------- /db01/api/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ApiConfig(AppConfig): 5 | name = 'api' 6 | -------------------------------------------------------------------------------- /db01/api/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-07 19:22 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='User', 16 | fields=[ 17 | ('username', models.CharField(max_length=100, primary_key=True, serialize=False)), 18 | ('password', models.CharField(max_length=200)), 19 | ('token', models.CharField(max_length=50)), 20 | ('type', models.CharField(choices=[('U', 'Standard User'), ('A', 'Admin'), ('S', 'Service Provider')], max_length=1)), 21 | ('email', models.EmailField(max_length=254)), 22 | ], 23 | ), 24 | ] 25 | -------------------------------------------------------------------------------- /db01/api/migrations/0002_auto_20190311_0945.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-11 09:45 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='user', 15 | name='username', 16 | ), 17 | migrations.AlterField( 18 | model_name='user', 19 | name='email', 20 | field=models.EmailField(max_length=100, primary_key=True, serialize=False), 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /db01/api/migrations/0003_auto_20190311_1047.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-11 10:47 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0002_auto_20190311_0945'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='user', 15 | name='password', 16 | field=models.CharField(max_length=500), 17 | ), 18 | migrations.AlterField( 19 | model_name='user', 20 | name='token', 21 | field=models.CharField(max_length=500), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /db01/api/migrations/0004_user_activated.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-11 11:22 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0003_auto_20190311_1047'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='user', 15 | name='activated', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /db01/api/migrations/0005_busservice.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-17 19:57 2 | 3 | import django.contrib.postgres.fields 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('api', '0004_user_activated'), 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='BusService', 16 | fields=[ 17 | ('id', models.CharField(max_length=100, primary_key=True, serialize=False)), 18 | ('name', models.CharField(max_length=100)), 19 | ('provider', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), size=None)), 20 | ('route', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), size=None)), 21 | ('timing', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=20), size=None)), 22 | ('price', models.IntegerField()), 23 | ('bus_number', models.CharField(max_length=20)), 24 | ('is_ready', models.BooleanField(default=False)), 25 | ], 26 | ), 27 | ] 28 | -------------------------------------------------------------------------------- /db01/api/migrations/0006_remove_busservice_provider.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-18 14:04 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0005_busservice'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='busservice', 15 | name='provider', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /db01/api/migrations/0007_auto_20190318_1410.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-18 14:10 2 | 3 | import api.models 4 | import django.contrib.postgres.fields 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('api', '0006_remove_busservice_provider'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='busservice', 17 | name='bus_number', 18 | field=models.CharField(default='', max_length=20), 19 | ), 20 | migrations.AlterField( 21 | model_name='busservice', 22 | name='route', 23 | field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), default=api.models.BusService.default_array_field, size=None), 24 | ), 25 | migrations.AlterField( 26 | model_name='busservice', 27 | name='timing', 28 | field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=20), default=api.models.BusService.default_array_field, size=None), 29 | ), 30 | ] 31 | -------------------------------------------------------------------------------- /db01/api/migrations/0008_auto_20190318_1412.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-18 14:12 2 | 3 | import api.models 4 | import django.contrib.postgres.fields 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('api', '0007_auto_20190318_1410'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='busservice', 17 | name='bus_number', 18 | field=models.CharField(blank=True, default='', max_length=20), 19 | ), 20 | migrations.AlterField( 21 | model_name='busservice', 22 | name='price', 23 | field=models.IntegerField(default=0), 24 | ), 25 | migrations.AlterField( 26 | model_name='busservice', 27 | name='route', 28 | field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=100), blank=True, default=api.models.BusService.default_array_field, size=None), 29 | ), 30 | migrations.AlterField( 31 | model_name='busservice', 32 | name='timing', 33 | field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=20), blank=True, default=api.models.BusService.default_array_field, size=None), 34 | ), 35 | ] 36 | -------------------------------------------------------------------------------- /db01/api/migrations/0009_busservice_provider.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-19 22:37 2 | 3 | import api.models 4 | import django.contrib.postgres.fields 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('api', '0008_auto_20190318_1412'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='busservice', 17 | name='provider', 18 | field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), default=api.models.BusService.default_array_field, size=None), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /db01/api/migrations/0010_busservice_seats.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-20 00:20 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0009_busservice_provider'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='busservice', 15 | name='seats', 16 | field=models.IntegerField(default=0), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /db01/api/migrations/0011_hotelservice.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-20 19:06 2 | 3 | import api.models 4 | import django.contrib.postgres.fields 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('api', '0010_busservice_seats'), 12 | ] 13 | 14 | operations = [ 15 | migrations.CreateModel( 16 | name='HotelService', 17 | fields=[ 18 | ('id', models.CharField(max_length=100, primary_key=True, serialize=False)), 19 | ('name', models.CharField(max_length=100)), 20 | ('location', models.CharField(blank=True, max_length=100)), 21 | ('check_in', models.CharField(blank=True, max_length=10)), 22 | ('check_out', models.CharField(blank=True, max_length=10)), 23 | ('price', models.IntegerField(default=0)), 24 | ('is_ready', models.BooleanField(default=False)), 25 | ('provider', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), default=api.models.HotelService.default_array_field, size=None)), 26 | ('rooms', models.IntegerField(default=0)), 27 | ], 28 | ), 29 | ] 30 | -------------------------------------------------------------------------------- /db01/api/migrations/0012_auto_20190321_2126.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-03-21 21:26 2 | 3 | import api.models 4 | import django.contrib.postgres.fields 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('api', '0011_hotelservice'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RemoveField( 16 | model_name='hotelservice', 17 | name='location', 18 | ), 19 | migrations.AddField( 20 | model_name='busservice', 21 | name='boarding_point', 22 | field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=100), blank=True, default=api.models.BusService.default_array_field, size=None), 23 | ), 24 | migrations.AddField( 25 | model_name='hotelservice', 26 | name='area', 27 | field=models.CharField(blank=True, default='', max_length=100), 28 | ), 29 | migrations.AddField( 30 | model_name='hotelservice', 31 | name='city', 32 | field=models.CharField(blank=True, default='', max_length=100), 33 | ), 34 | ] 35 | -------------------------------------------------------------------------------- /db01/api/migrations/0013_hotelservice_address.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-07 10:21 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0012_auto_20190321_2126'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='hotelservice', 15 | name='address', 16 | field=models.CharField(blank=True, default='', max_length=200), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /db01/api/migrations/0014_auto_20190407_1346.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-07 13:46 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0013_hotelservice_address'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='hotelservice', 15 | name='check_in', 16 | field=models.TimeField(blank=True), 17 | ), 18 | migrations.AlterField( 19 | model_name='hotelservice', 20 | name='check_out', 21 | field=models.TimeField(blank=True), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /db01/api/migrations/0015_auto_20190407_1356.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-07 13:56 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0014_auto_20190407_1346'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='hotelservice', 15 | name='check_in', 16 | field=models.TimeField(blank=True, null=True), 17 | ), 18 | migrations.AlterField( 19 | model_name='hotelservice', 20 | name='check_out', 21 | field=models.TimeField(blank=True, null=True), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /db01/api/migrations/0016_hotelbooking.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-08 19:01 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0015_auto_20190407_1356'), 10 | ] 11 | 12 | operations = [ 13 | migrations.CreateModel( 14 | name='HotelBooking', 15 | fields=[ 16 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 17 | ('service', models.CharField(max_length=100)), 18 | ('email', models.EmailField(max_length=100)), 19 | ('check_in', models.DateField()), 20 | ('check_out', models.DateField()), 21 | ], 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /db01/api/migrations/0017_auto_20190408_1937.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-08 19:37 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0016_hotelbooking'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='hotelbooking', 15 | name='area', 16 | field=models.CharField(default='', max_length=100), 17 | ), 18 | migrations.AddField( 19 | model_name='hotelbooking', 20 | name='city', 21 | field=models.CharField(default='', max_length=100), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /db01/api/migrations/0018_auto_20190408_2034.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-08 20:34 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0017_auto_20190408_1937'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='hotelbooking', 15 | old_name='service', 16 | new_name='service_id', 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /db01/api/migrations/0019_hotelbooking_booking_date.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-09 06:49 2 | 3 | import datetime 4 | from django.db import migrations, models 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('api', '0018_auto_20190408_2034'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AddField( 15 | model_name='hotelbooking', 16 | name='booking_date', 17 | field=models.DateField(default=datetime.date(2019, 4, 9)), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /db01/api/migrations/0020_auto_20190409_0650.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-09 06:50 2 | 3 | from django.db import migrations, models 4 | import django.utils.timezone 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('api', '0019_hotelbooking_booking_date'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='hotelbooking', 16 | name='booking_date', 17 | field=models.DateField(default=django.utils.timezone.now), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /db01/api/migrations/0021_auto_20190411_2117.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-11 21:17 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0020_auto_20190409_0650'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='hotelbooking', 15 | old_name='check_in', 16 | new_name='in_date', 17 | ), 18 | migrations.RenameField( 19 | model_name='hotelbooking', 20 | old_name='check_out', 21 | new_name='out_date', 22 | ), 23 | migrations.RemoveField( 24 | model_name='hotelbooking', 25 | name='area', 26 | ), 27 | migrations.RemoveField( 28 | model_name='hotelbooking', 29 | name='city', 30 | ), 31 | migrations.AlterField( 32 | model_name='hotelbooking', 33 | name='id', 34 | field=models.CharField(max_length=100, primary_key=True, serialize=False), 35 | ), 36 | ] 37 | -------------------------------------------------------------------------------- /db01/api/migrations/0022_hotelbooking_rooms.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-11 21:18 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0021_auto_20190411_2117'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='hotelbooking', 15 | name='rooms', 16 | field=models.IntegerField(default=0), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /db01/api/migrations/0023_hotelbooking_bill.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-11 21:28 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0022_hotelbooking_rooms'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='hotelbooking', 15 | name='bill', 16 | field=models.IntegerField(default=0), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /db01/api/migrations/0024_hotelservice_description.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-13 16:52 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0023_hotelbooking_bill'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='hotelservice', 15 | name='description', 16 | field=models.CharField(blank=True, default='', max_length=1000), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /db01/api/migrations/0025_auto_20190424_1634.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-24 16:34 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api', '0024_hotelservice_description'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='hotelservice', 15 | name='description', 16 | field=models.CharField(blank=True, default='', max_length=1000, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /db01/api/migrations/0026_busbooking.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-29 20:02 2 | 3 | from django.db import migrations, models 4 | import django.utils.timezone 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('api', '0025_auto_20190424_1634'), 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='BusBooking', 16 | fields=[ 17 | ('id', models.CharField(max_length=100, primary_key=True, serialize=False)), 18 | ('service_id', models.CharField(max_length=100)), 19 | ('email', models.EmailField(max_length=100)), 20 | ('From', models.CharField(default='', max_length=100)), 21 | ('To', models.CharField(default='', max_length=100)), 22 | ('TravelDate', models.DateField(default=django.utils.timezone.now, null=True)), 23 | ('booking_date', models.DateField(default=django.utils.timezone.now)), 24 | ('seats', models.IntegerField(default=0)), 25 | ('bill', models.IntegerField(default=0)), 26 | ], 27 | ), 28 | ] 29 | -------------------------------------------------------------------------------- /db01/api/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__init__.py -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0001_initial.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0001_initial.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0002_auto_20190311_0945.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0002_auto_20190311_0945.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0003_auto_20190311_1047.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0003_auto_20190311_1047.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0004_user_activated.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0004_user_activated.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0005_busservice.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0005_busservice.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0006_remove_busservice_provider.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0006_remove_busservice_provider.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0007_auto_20190318_1410.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0007_auto_20190318_1410.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0008_auto_20190318_1412.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0008_auto_20190318_1412.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0009_busservice_provider.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0009_busservice_provider.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0010_busservice_seats.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0010_busservice_seats.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0011_hotelservice.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0011_hotelservice.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0012_auto_20190321_2126.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0012_auto_20190321_2126.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0013_hotelservice_address.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0013_hotelservice_address.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0014_auto_20190407_1346.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0014_auto_20190407_1346.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0015_auto_20190407_1356.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0015_auto_20190407_1356.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0016_hotelbooking.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0016_hotelbooking.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0017_auto_20190408_1937.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0017_auto_20190408_1937.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0018_auto_20190408_2034.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0018_auto_20190408_2034.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0019_hotelbooking_booking_date.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0019_hotelbooking_booking_date.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0020_auto_20190409_0650.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0020_auto_20190409_0650.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0021_auto_20190411_2117.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0021_auto_20190411_2117.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0022_hotelbooking_rooms.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0022_hotelbooking_rooms.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0023_hotelbooking_bill.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0023_hotelbooking_bill.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0024_hotelservice_description.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0024_hotelservice_description.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0025_auto_20190424_1634.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0025_auto_20190424_1634.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/0026_busbooking.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/0026_busbooking.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/api/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /db01/api/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.postgres.fields import ArrayField 3 | from django.utils import timezone 4 | 5 | class User(models.Model): 6 | USER_TYPES = ( 7 | ('U', 'Standard User'), 8 | ('A', 'Admin'), 9 | ('S', 'Service Provider'), 10 | ) 11 | email = models.EmailField(primary_key = True, null = False, max_length = 100) 12 | password = models.CharField(max_length = 500, null = False) 13 | token = models.CharField(max_length = 500, null = False) 14 | type = models.CharField(max_length = 1, choices = USER_TYPES, null = False) 15 | activated = models.BooleanField(default = False) 16 | 17 | def __str__(self): 18 | return self.email 19 | 20 | class BusService(models.Model): 21 | 22 | def default_array_field(): 23 | return list([]) 24 | 25 | id = models.CharField(primary_key = True, null = False, max_length = 100) 26 | name = models.CharField(null = False, max_length = 100) 27 | route = ArrayField(models.CharField(max_length = 100, blank = True), default = default_array_field, blank = True) 28 | timing = ArrayField(models.CharField(max_length = 20, blank = True), default = default_array_field, blank = True) 29 | boarding_point = ArrayField(models.CharField(max_length = 100, blank = True), default = default_array_field, blank = True) 30 | price = models.IntegerField(default = 0) 31 | bus_number = models.CharField(max_length = 20, default = '', blank = True) 32 | is_ready = models.BooleanField(default = False) 33 | provider = ArrayField(models.CharField(max_length = 100), default = default_array_field) 34 | seats = models.IntegerField(default = 0) 35 | 36 | def __str__(self): 37 | return self.name 38 | 39 | class HotelService(models.Model): 40 | 41 | def default_array_field(): 42 | return list([]) 43 | 44 | id = models.CharField(primary_key = True, null = False, max_length = 100) 45 | name = models.CharField(null = False, max_length = 100) 46 | city = models.CharField(max_length = 100, blank = True, default = '') 47 | description = models.CharField(max_length = 1000, blank = True, default = '', null = True) 48 | area = models.CharField(max_length = 100, blank = True, default = '') 49 | address = models.CharField(max_length = 200, blank = True, default = '') 50 | check_in = models.TimeField(blank = True, null = True) 51 | check_out = models.TimeField(blank = True, null = True) 52 | price = models.IntegerField(default = 0) 53 | is_ready = models.BooleanField(default = False) 54 | provider = ArrayField(models.CharField(max_length = 100), default = default_array_field) 55 | rooms = models.IntegerField(default = 0) 56 | 57 | def __str__(self): 58 | return self.name 59 | 60 | class HotelBooking(models.Model): 61 | 62 | id = models.CharField(primary_key = True, null = False, max_length = 100) 63 | service_id = models.CharField(null = False, max_length = 100) 64 | email = models.EmailField(null = False, max_length = 100) 65 | in_date = models.DateField(null = False) 66 | out_date = models.DateField(null = False) 67 | booking_date = models.DateField(default = timezone.now) 68 | rooms = models.IntegerField(default = 0) 69 | bill = models.IntegerField(default = 0) 70 | 71 | def __str__(self): 72 | return self.email 73 | 74 | class BusBooking(models.Model): 75 | 76 | id = models.CharField(primary_key = True, null = False, max_length = 100) 77 | service_id = models.CharField(null = False, max_length = 100) 78 | email = models.EmailField(null = False, max_length = 100) 79 | From = models.CharField(null = False, max_length = 100, default = "") 80 | To = models.CharField(null = False, max_length = 100, default = "") 81 | TravelDate = models.DateField(default = timezone.now, null = True) 82 | booking_date = models.DateField(default = timezone.now) 83 | seats = models.IntegerField(default = 0) 84 | bill = models.IntegerField(default = 0) 85 | 86 | def __str__(self): 87 | return self.email 88 | -------------------------------------------------------------------------------- /db01/api/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from .models import User, BusService, HotelService, HotelBooking, BusBooking 3 | 4 | class UserSerializer(serializers.ModelSerializer): 5 | 6 | class Meta: 7 | model = User 8 | fields = ('password', 'email', 'type', 'token', 'activated', ) 9 | 10 | class BusSerializer(serializers.ModelSerializer): 11 | 12 | class Meta: 13 | model = BusService 14 | fields = ('id', 'name', 'route', 'timing', 'price', 'bus_number', 'is_ready', 'provider', 'seats', 'boarding_point', ) 15 | 16 | class HotelSerializer(serializers.ModelSerializer): 17 | 18 | class Meta: 19 | model = HotelService 20 | fields = ('id', 'name', 'city', 'area', 'check_in', 'check_out', 'price', 'is_ready', 'provider', 'rooms', 'address', 'description', ) 21 | 22 | class UpdateStatusSerializer(serializers.Serializer): 23 | 24 | db_addr_1 = serializers.BooleanField() 25 | db_addr_2 = serializers.BooleanField() 26 | 27 | class HotelBookingSerializer(serializers.ModelSerializer): 28 | 29 | class Meta: 30 | model = HotelBooking 31 | fields = ('id', 'service_id', 'email', 'in_date', 'out_date', 'booking_date', 'rooms', 'bill', ) 32 | 33 | class HotelBookingInfoSerializer(serializers.ModelSerializer): 34 | 35 | class Meta: 36 | model = HotelBooking 37 | fields = ('id', 'service_id', 'in_date', 'out_date', 'rooms', ) 38 | 39 | class BusBookingSerializer(serializers.ModelSerializer): 40 | 41 | class Meta: 42 | model = BusBooking 43 | fields = ('id', 'service_id', 'email', 'From', 'To', 'booking_date', 'seats', 'bill', 'TravelDate', ) 44 | -------------------------------------------------------------------------------- /db01/api/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /db01/api/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import path 3 | from . import views 4 | 5 | app_name = 'api' 6 | 7 | urlpatterns = [ 8 | 9 | path('user/list', views.UserList.as_view()), 10 | path('user/get', views.GetUser.as_view()), 11 | path('user/insert', views.InsertUser.as_view()), 12 | path('user/update', views.UpdateUser.as_view()), 13 | path('bus/list', views.BusServiceList.as_view()), 14 | path('bus/insert', views.NewBusService.as_view()), 15 | path('bus/delete', views.DeleteBusService.as_view()), 16 | path('bus/list/email', views.BusServiceListEmail.as_view()), 17 | path('bus/update', views.UpdateBusService.as_view()), 18 | path('bus/get', views.GetBusService.as_view()), 19 | path('hotels/list', views.HotelServiceList.as_view()), 20 | path('hotels/insert', views.NewHotelService.as_view()), 21 | path('hotels/update', views.UpdateHotelService.as_view()), 22 | path('hotels/get', views.GetHotelService.as_view()), 23 | path('hotels/delete', views.DeleteHotelService.as_view()), 24 | path('hotels/list/email', views.HotelServiceListEmail.as_view()), 25 | path('hotels/list/city', views.GetHotelByCity.as_view()), 26 | path('bookings/hotel/list', views.HotelBookingList.as_view()), 27 | path('bookings/hotel/new', views.NewHotelBooking.as_view()), 28 | path('bookings/hotel/get', views.HotelBookingByHotel.as_view()), 29 | path('bookings/hotel/user/', views.GetHotelBookingByUser.as_view()), 30 | path('bookings/hotel/id/', views.GetHotelBookingById.as_view()), 31 | path('bookings/hotel/delete', views.DeleteHotelBooking.as_view()), 32 | path('bookings/hotel/date', views.HotelBookingsByDate.as_view()), 33 | path('status', views.StatusView.as_view()), 34 | 35 | path('bus/list/city', views.GetBusByCity.as_view()), 36 | path('bookings/bus/get', views.BusBookingByBus.as_view()), 37 | path('bookings/bus/new', views.NewBusBooking.as_view()), 38 | path('bookings/bus/id/', views.GetBusBookingById.as_view()), 39 | path('bookings/bus/delete', views.DeleteBusBooking.as_view()), 40 | path('bookings/bus/user/', views.GetBusBookingByUser.as_view()), 41 | path('bookings/bus/date', views.BusBookingsByDate.as_view()), 42 | 43 | ] 44 | -------------------------------------------------------------------------------- /db01/db01/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/db01/__init__.py -------------------------------------------------------------------------------- /db01/db01/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/db01/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /db01/db01/__pycache__/settings.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/db01/__pycache__/settings.cpython-36.pyc -------------------------------------------------------------------------------- /db01/db01/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/db01/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /db01/db01/__pycache__/wsgi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db01/db01/__pycache__/wsgi.cpython-36.pyc -------------------------------------------------------------------------------- /db01/db01/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for db01 project. 3 | 4 | Generated by 'django-admin startproject' using Django 2.1.7. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/2.1/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = 'p36@c%mx)0qu9l#d$=xc$q%%%4(x==yu4lq34t9=q9i%_6@v+u' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'rest_framework', 41 | 'api', 42 | ] 43 | 44 | MIDDLEWARE = [ 45 | 'django.middleware.security.SecurityMiddleware', 46 | 'django.contrib.sessions.middleware.SessionMiddleware', 47 | 'django.middleware.common.CommonMiddleware', 48 | 'django.middleware.csrf.CsrfViewMiddleware', 49 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 50 | 'django.contrib.messages.middleware.MessageMiddleware', 51 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 52 | ] 53 | 54 | ROOT_URLCONF = 'db01.urls' 55 | 56 | TEMPLATES = [ 57 | { 58 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 59 | 'DIRS': [], 60 | 'APP_DIRS': True, 61 | 'OPTIONS': { 62 | 'context_processors': [ 63 | 'django.template.context_processors.debug', 64 | 'django.template.context_processors.request', 65 | 'django.contrib.auth.context_processors.auth', 66 | 'django.contrib.messages.context_processors.messages', 67 | ], 68 | }, 69 | }, 70 | ] 71 | 72 | WSGI_APPLICATION = 'db01.wsgi.application' 73 | 74 | 75 | # Database 76 | # https://docs.djangoproject.com/en/2.1/ref/settings/#databases 77 | 78 | DATABASES = { 79 | 'default': { 80 | 'ENGINE': 'django.db.backends.postgresql_psycopg2', 81 | 'NAME': 'dumbape', 82 | 'USER': 'dumbape', 83 | 'PASSWORD': 'iiita123', 84 | 'HOST': 'localhost', 85 | 'PORT': '5441', 86 | } 87 | } 88 | 89 | 90 | # Password validation 91 | # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators 92 | 93 | AUTH_PASSWORD_VALIDATORS = [ 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 96 | }, 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 102 | }, 103 | { 104 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 105 | }, 106 | ] 107 | 108 | 109 | # Internationalization 110 | # https://docs.djangoproject.com/en/2.1/topics/i18n/ 111 | 112 | LANGUAGE_CODE = 'en-us' 113 | 114 | TIME_ZONE = 'UTC' 115 | 116 | USE_I18N = True 117 | 118 | USE_L10N = True 119 | 120 | USE_TZ = True 121 | 122 | 123 | # Static files (CSS, JavaScript, Images) 124 | # https://docs.djangoproject.com/en/2.1/howto/static-files/ 125 | 126 | STATIC_URL = '/static/' 127 | -------------------------------------------------------------------------------- /db01/db01/urls.py: -------------------------------------------------------------------------------- 1 | """db01 URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path 18 | from django.urls import include 19 | 20 | urlpatterns = [ 21 | path('admin/', admin.site.urls), 22 | path('api/', include('api.urls')), 23 | ] 24 | -------------------------------------------------------------------------------- /db01/db01/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for db01 project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'db01.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /db01/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == '__main__': 6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'db01.settings') 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError as exc: 10 | raise ImportError( 11 | "Couldn't import Django. Are you sure it's installed and " 12 | "available on your PYTHONPATH environment variable? Did you " 13 | "forget to activate a virtual environment?" 14 | ) from exc 15 | execute_from_command_line(sys.argv) 16 | -------------------------------------------------------------------------------- /db02/api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/api/__init__.py -------------------------------------------------------------------------------- /db02/api/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/api/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /db02/api/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/api/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /db02/api/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/api/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /db02/api/__pycache__/serializers.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/api/__pycache__/serializers.cpython-36.pyc -------------------------------------------------------------------------------- /db02/api/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/api/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /db02/api/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/api/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /db02/api/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from . import models 3 | 4 | class UserAdmin(admin.ModelAdmin): 5 | readonly_fields = ('password', 'token', 'email', ) 6 | 7 | admin.site.register(models.User) 8 | admin.site.register(models.BusService) 9 | admin.site.register(models.HotelService) 10 | admin.site.register(models.HotelBooking) 11 | admin.site.register(models.BusBooking) 12 | -------------------------------------------------------------------------------- /db02/api/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ApiConfig(AppConfig): 5 | name = 'api' 6 | -------------------------------------------------------------------------------- /db02/api/migrations/0002_busbooking.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-29 20:03 2 | 3 | from django.db import migrations, models 4 | import django.utils.timezone 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('api', '0001_initial'), 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='BusBooking', 16 | fields=[ 17 | ('id', models.CharField(max_length=100, primary_key=True, serialize=False)), 18 | ('service_id', models.CharField(max_length=100)), 19 | ('email', models.EmailField(max_length=100)), 20 | ('From', models.CharField(default='', max_length=100)), 21 | ('To', models.CharField(default='', max_length=100)), 22 | ('TravelDate', models.DateField(default=django.utils.timezone.now, null=True)), 23 | ('booking_date', models.DateField(default=django.utils.timezone.now)), 24 | ('seats', models.IntegerField(default=0)), 25 | ('bill', models.IntegerField(default=0)), 26 | ], 27 | ), 28 | ] 29 | -------------------------------------------------------------------------------- /db02/api/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/api/migrations/__init__.py -------------------------------------------------------------------------------- /db02/api/migrations/__pycache__/0001_initial.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/api/migrations/__pycache__/0001_initial.cpython-36.pyc -------------------------------------------------------------------------------- /db02/api/migrations/__pycache__/0002_busbooking.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/api/migrations/__pycache__/0002_busbooking.cpython-36.pyc -------------------------------------------------------------------------------- /db02/api/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/api/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /db02/api/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.postgres.fields import ArrayField 3 | from django.utils import timezone 4 | 5 | class User(models.Model): 6 | USER_TYPES = ( 7 | ('U', 'Standard User'), 8 | ('A', 'Admin'), 9 | ('S', 'Service Provider'), 10 | ) 11 | email = models.EmailField(primary_key = True, null = False, max_length = 100) 12 | password = models.CharField(max_length = 500, null = False) 13 | token = models.CharField(max_length = 500, null = False) 14 | type = models.CharField(max_length = 1, choices = USER_TYPES, null = False) 15 | activated = models.BooleanField(default = False) 16 | 17 | def __str__(self): 18 | return self.email 19 | 20 | class BusService(models.Model): 21 | 22 | def default_array_field(): 23 | return list([]) 24 | 25 | id = models.CharField(primary_key = True, null = False, max_length = 100) 26 | name = models.CharField(null = False, max_length = 100) 27 | route = ArrayField(models.CharField(max_length = 100, blank = True), default = default_array_field, blank = True) 28 | timing = ArrayField(models.CharField(max_length = 20, blank = True), default = default_array_field, blank = True) 29 | boarding_point = ArrayField(models.CharField(max_length = 100, blank = True), default = default_array_field, blank = True) 30 | price = models.IntegerField(default = 0) 31 | bus_number = models.CharField(max_length = 20, default = '', blank = True) 32 | is_ready = models.BooleanField(default = False) 33 | provider = ArrayField(models.CharField(max_length = 100), default = default_array_field) 34 | seats = models.IntegerField(default = 0) 35 | 36 | def __str__(self): 37 | return self.name 38 | 39 | class HotelService(models.Model): 40 | 41 | def default_array_field(): 42 | return list([]) 43 | 44 | id = models.CharField(primary_key = True, null = False, max_length = 100) 45 | name = models.CharField(null = False, max_length = 100) 46 | city = models.CharField(max_length = 100, blank = True, default = '') 47 | description = models.CharField(max_length = 1000, blank = True, default = '', null = True) 48 | area = models.CharField(max_length = 100, blank = True, default = '') 49 | address = models.CharField(max_length = 200, blank = True, default = '') 50 | check_in = models.TimeField(blank = True, null = True) 51 | check_out = models.TimeField(blank = True, null = True) 52 | price = models.IntegerField(default = 0) 53 | is_ready = models.BooleanField(default = False) 54 | provider = ArrayField(models.CharField(max_length = 100), default = default_array_field) 55 | rooms = models.IntegerField(default = 0) 56 | 57 | def __str__(self): 58 | return self.name 59 | 60 | class HotelBooking(models.Model): 61 | 62 | id = models.CharField(primary_key = True, null = False, max_length = 100) 63 | service_id = models.CharField(null = False, max_length = 100) 64 | email = models.EmailField(null = False, max_length = 100) 65 | in_date = models.DateField(null = False) 66 | out_date = models.DateField(null = False) 67 | booking_date = models.DateField(default = timezone.now) 68 | rooms = models.IntegerField(default = 0) 69 | bill = models.IntegerField(default = 0) 70 | 71 | def __str__(self): 72 | return self.email 73 | 74 | class BusBooking(models.Model): 75 | 76 | id = models.CharField(primary_key = True, null = False, max_length = 100) 77 | service_id = models.CharField(null = False, max_length = 100) 78 | email = models.EmailField(null = False, max_length = 100) 79 | From = models.CharField(null = False, max_length = 100, default = "") 80 | To = models.CharField(null = False, max_length = 100, default = "") 81 | TravelDate = models.DateField(default = timezone.now, null = True) 82 | booking_date = models.DateField(default = timezone.now) 83 | seats = models.IntegerField(default = 0) 84 | bill = models.IntegerField(default = 0) 85 | 86 | def __str__(self): 87 | return self.email 88 | -------------------------------------------------------------------------------- /db02/api/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from .models import User, BusService, HotelService, HotelBooking, BusBooking 3 | 4 | class UserSerializer(serializers.ModelSerializer): 5 | 6 | class Meta: 7 | model = User 8 | fields = ('password', 'email', 'type', 'token', 'activated', ) 9 | 10 | class BusSerializer(serializers.ModelSerializer): 11 | 12 | class Meta: 13 | model = BusService 14 | fields = ('id', 'name', 'route', 'timing', 'price', 'bus_number', 'is_ready', 'provider', 'seats', 'boarding_point', ) 15 | 16 | class HotelSerializer(serializers.ModelSerializer): 17 | 18 | class Meta: 19 | model = HotelService 20 | fields = ('id', 'name', 'city', 'area', 'check_in', 'check_out', 'price', 'is_ready', 'provider', 'rooms', 'address', 'description', ) 21 | 22 | class HotelBookingSerializer(serializers.ModelSerializer): 23 | 24 | class Meta: 25 | model = HotelBooking 26 | fields = ('id', 'service_id', 'email', 'in_date', 'out_date', 'booking_date', 'rooms', 'bill', ) 27 | 28 | class HotelBookingInfoSerializer(serializers.ModelSerializer): 29 | 30 | class Meta: 31 | model = HotelBooking 32 | fields = ('id', 'service_id', 'in_date', 'out_date', 'rooms', ) 33 | 34 | class UpdateStatusSerializer(serializers.Serializer): 35 | 36 | db_addr_1 = serializers.BooleanField() 37 | db_addr_2 = serializers.BooleanField() 38 | 39 | class BusBookingSerializer(serializers.ModelSerializer): 40 | 41 | class Meta: 42 | model = BusBooking 43 | fields = ('id', 'service_id', 'email', 'From', 'To', 'booking_date', 'seats', 'bill', 'TravelDate', ) 44 | -------------------------------------------------------------------------------- /db02/api/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /db02/api/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import path 3 | from . import views 4 | 5 | app_name = 'api' 6 | 7 | urlpatterns = [ 8 | 9 | path('user/list', views.UserList.as_view()), 10 | path('user/get', views.GetUser.as_view()), 11 | path('user/insert', views.InsertUser.as_view()), 12 | path('user/update', views.UpdateUser.as_view()), 13 | path('bus/list', views.BusServiceList.as_view()), 14 | path('bus/insert', views.NewBusService.as_view()), 15 | path('bus/delete', views.DeleteBusService.as_view()), 16 | path('bus/list/email', views.BusServiceListEmail.as_view()), 17 | path('bus/update', views.UpdateBusService.as_view()), 18 | path('bus/get', views.GetBusService.as_view()), 19 | path('hotels/list', views.HotelServiceList.as_view()), 20 | path('hotels/insert', views.NewHotelService.as_view()), 21 | path('hotels/update', views.UpdateHotelService.as_view()), 22 | path('hotels/get', views.GetHotelService.as_view()), 23 | path('hotels/delete', views.DeleteHotelService.as_view()), 24 | path('hotels/list/email', views.HotelServiceListEmail.as_view()), 25 | path('hotels/list/city', views.GetHotelByCity.as_view()), 26 | path('bookings/hotel/list', views.HotelBookingList.as_view()), 27 | path('bookings/hotel/new', views.NewHotelBooking.as_view()), 28 | path('bookings/hotel/get', views.HotelBookingByHotel.as_view()), 29 | path('bookings/hotel/user/', views.GetHotelBookingByUser.as_view()), 30 | path('bookings/hotel/id/', views.GetHotelBookingById.as_view()), 31 | path('bookings/hotel/delete', views.DeleteHotelBooking.as_view()), 32 | path('bookings/hotel/date', views.HotelBookingsByDate.as_view()), 33 | path('status', views.StatusView.as_view()), 34 | 35 | path('bus/list/city', views.GetBusByCity.as_view()), 36 | path('bookings/bus/get', views.BusBookingByBus.as_view()), 37 | path('bookings/bus/new', views.NewBusBooking.as_view()), 38 | path('bookings/bus/id/', views.GetBusBookingById.as_view()), 39 | path('bookings/bus/delete', views.DeleteBusBooking.as_view()), 40 | path('bookings/bus/user/', views.GetBusBookingByUser.as_view()), 41 | path('bookings/bus/date', views.BusBookingsByDate.as_view()), 42 | 43 | ] 44 | -------------------------------------------------------------------------------- /db02/db02/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/db02/__init__.py -------------------------------------------------------------------------------- /db02/db02/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/db02/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /db02/db02/__pycache__/settings.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/db02/__pycache__/settings.cpython-36.pyc -------------------------------------------------------------------------------- /db02/db02/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/db02/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /db02/db02/__pycache__/wsgi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db02/db02/__pycache__/wsgi.cpython-36.pyc -------------------------------------------------------------------------------- /db02/db02/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for db02 project. 3 | 4 | Generated by 'django-admin startproject' using Django 2.1.7. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/2.1/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = '=_v!i!!#q0kjc$so132jpw&utp*6rdz%d9@gezf)&zfz-t7_ko' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'rest_framework', 41 | 'api', 42 | ] 43 | 44 | MIDDLEWARE = [ 45 | 'django.middleware.security.SecurityMiddleware', 46 | 'django.contrib.sessions.middleware.SessionMiddleware', 47 | 'django.middleware.common.CommonMiddleware', 48 | 'django.middleware.csrf.CsrfViewMiddleware', 49 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 50 | 'django.contrib.messages.middleware.MessageMiddleware', 51 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 52 | ] 53 | 54 | ROOT_URLCONF = 'db02.urls' 55 | 56 | TEMPLATES = [ 57 | { 58 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 59 | 'DIRS': [], 60 | 'APP_DIRS': True, 61 | 'OPTIONS': { 62 | 'context_processors': [ 63 | 'django.template.context_processors.debug', 64 | 'django.template.context_processors.request', 65 | 'django.contrib.auth.context_processors.auth', 66 | 'django.contrib.messages.context_processors.messages', 67 | ], 68 | }, 69 | }, 70 | ] 71 | 72 | WSGI_APPLICATION = 'db02.wsgi.application' 73 | 74 | 75 | # Database 76 | # https://docs.djangoproject.com/en/2.1/ref/settings/#databases 77 | 78 | DATABASES = { 79 | 'default': { 80 | 'ENGINE': 'django.db.backends.postgresql_psycopg2', 81 | 'NAME': 'dumbape', 82 | 'USER': 'dumbape', 83 | 'PASSWORD': 'iiita123', 84 | 'HOST': 'localhost', 85 | 'PORT': '5442', 86 | } 87 | } 88 | 89 | 90 | # Password validation 91 | # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators 92 | 93 | AUTH_PASSWORD_VALIDATORS = [ 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 96 | }, 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 102 | }, 103 | { 104 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 105 | }, 106 | ] 107 | 108 | 109 | # Internationalization 110 | # https://docs.djangoproject.com/en/2.1/topics/i18n/ 111 | 112 | LANGUAGE_CODE = 'en-us' 113 | 114 | TIME_ZONE = 'UTC' 115 | 116 | USE_I18N = True 117 | 118 | USE_L10N = True 119 | 120 | USE_TZ = True 121 | 122 | 123 | # Static files (CSS, JavaScript, Images) 124 | # https://docs.djangoproject.com/en/2.1/howto/static-files/ 125 | 126 | STATIC_URL = '/static/' 127 | -------------------------------------------------------------------------------- /db02/db02/urls.py: -------------------------------------------------------------------------------- 1 | """db01 URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path 18 | from django.urls import include 19 | 20 | urlpatterns = [ 21 | path('admin/', admin.site.urls), 22 | path('api/', include('api.urls')), 23 | ] 24 | -------------------------------------------------------------------------------- /db02/db02/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for db02 project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'db02.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /db02/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == '__main__': 6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'db02.settings') 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError as exc: 10 | raise ImportError( 11 | "Couldn't import Django. Are you sure it's installed and " 12 | "available on your PYTHONPATH environment variable? Did you " 13 | "forget to activate a virtual environment?" 14 | ) from exc 15 | execute_from_command_line(sys.argv) 16 | -------------------------------------------------------------------------------- /db03/api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/api/__init__.py -------------------------------------------------------------------------------- /db03/api/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/api/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /db03/api/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/api/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /db03/api/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/api/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /db03/api/__pycache__/serializers.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/api/__pycache__/serializers.cpython-36.pyc -------------------------------------------------------------------------------- /db03/api/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/api/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /db03/api/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/api/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /db03/api/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from . import models 3 | 4 | class UserAdmin(admin.ModelAdmin): 5 | readonly_fields = ('password', 'token', 'email', ) 6 | 7 | admin.site.register(models.User) 8 | admin.site.register(models.BusService) 9 | admin.site.register(models.HotelService) 10 | admin.site.register(models.HotelBooking) 11 | admin.site.register(models.BusBooking) 12 | -------------------------------------------------------------------------------- /db03/api/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ApiConfig(AppConfig): 5 | name = 'api' 6 | -------------------------------------------------------------------------------- /db03/api/migrations/0002_busbooking.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-29 20:03 2 | 3 | from django.db import migrations, models 4 | import django.utils.timezone 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('api', '0001_initial'), 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='BusBooking', 16 | fields=[ 17 | ('id', models.CharField(max_length=100, primary_key=True, serialize=False)), 18 | ('service_id', models.CharField(max_length=100)), 19 | ('email', models.EmailField(max_length=100)), 20 | ('From', models.CharField(default='', max_length=100)), 21 | ('To', models.CharField(default='', max_length=100)), 22 | ('TravelDate', models.DateField(default=django.utils.timezone.now, null=True)), 23 | ('booking_date', models.DateField(default=django.utils.timezone.now)), 24 | ('seats', models.IntegerField(default=0)), 25 | ('bill', models.IntegerField(default=0)), 26 | ], 27 | ), 28 | ] 29 | -------------------------------------------------------------------------------- /db03/api/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/api/migrations/__init__.py -------------------------------------------------------------------------------- /db03/api/migrations/__pycache__/0001_initial.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/api/migrations/__pycache__/0001_initial.cpython-36.pyc -------------------------------------------------------------------------------- /db03/api/migrations/__pycache__/0002_busbooking.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/api/migrations/__pycache__/0002_busbooking.cpython-36.pyc -------------------------------------------------------------------------------- /db03/api/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/api/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /db03/api/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.postgres.fields import ArrayField 3 | from django.utils import timezone 4 | 5 | class User(models.Model): 6 | USER_TYPES = ( 7 | ('U', 'Standard User'), 8 | ('A', 'Admin'), 9 | ('S', 'Service Provider'), 10 | ) 11 | email = models.EmailField(primary_key = True, null = False, max_length = 100) 12 | password = models.CharField(max_length = 500, null = False) 13 | token = models.CharField(max_length = 500, null = False) 14 | type = models.CharField(max_length = 1, choices = USER_TYPES, null = False) 15 | activated = models.BooleanField(default = False) 16 | 17 | def __str__(self): 18 | return self.email 19 | 20 | class BusService(models.Model): 21 | 22 | def default_array_field(): 23 | return list([]) 24 | 25 | id = models.CharField(primary_key = True, null = False, max_length = 100) 26 | name = models.CharField(null = False, max_length = 100) 27 | route = ArrayField(models.CharField(max_length = 100, blank = True), default = default_array_field, blank = True) 28 | timing = ArrayField(models.CharField(max_length = 20, blank = True), default = default_array_field, blank = True) 29 | boarding_point = ArrayField(models.CharField(max_length = 100, blank = True), default = default_array_field, blank = True) 30 | price = models.IntegerField(default = 0) 31 | bus_number = models.CharField(max_length = 20, default = '', blank = True) 32 | is_ready = models.BooleanField(default = False) 33 | provider = ArrayField(models.CharField(max_length = 100), default = default_array_field) 34 | seats = models.IntegerField(default = 0) 35 | 36 | def __str__(self): 37 | return self.name 38 | 39 | class HotelService(models.Model): 40 | 41 | def default_array_field(): 42 | return list([]) 43 | 44 | id = models.CharField(primary_key = True, null = False, max_length = 100) 45 | name = models.CharField(null = False, max_length = 100) 46 | city = models.CharField(max_length = 100, blank = True, default = '') 47 | description = models.CharField(max_length = 1000, blank = True, default = '', null = True) 48 | area = models.CharField(max_length = 100, blank = True, default = '') 49 | address = models.CharField(max_length = 200, blank = True, default = '') 50 | check_in = models.TimeField(blank = True, null = True) 51 | check_out = models.TimeField(blank = True, null = True) 52 | price = models.IntegerField(default = 0) 53 | is_ready = models.BooleanField(default = False) 54 | provider = ArrayField(models.CharField(max_length = 100), default = default_array_field) 55 | rooms = models.IntegerField(default = 0) 56 | 57 | def __str__(self): 58 | return self.name 59 | 60 | class HotelBooking(models.Model): 61 | 62 | id = models.CharField(primary_key = True, null = False, max_length = 100) 63 | service_id = models.CharField(null = False, max_length = 100) 64 | email = models.EmailField(null = False, max_length = 100) 65 | in_date = models.DateField(null = False) 66 | out_date = models.DateField(null = False) 67 | booking_date = models.DateField(default = timezone.now) 68 | rooms = models.IntegerField(default = 0) 69 | bill = models.IntegerField(default = 0) 70 | 71 | def __str__(self): 72 | return self.email 73 | 74 | class BusBooking(models.Model): 75 | 76 | id = models.CharField(primary_key = True, null = False, max_length = 100) 77 | service_id = models.CharField(null = False, max_length = 100) 78 | email = models.EmailField(null = False, max_length = 100) 79 | From = models.CharField(null = False, max_length = 100, default = "") 80 | To = models.CharField(null = False, max_length = 100, default = "") 81 | TravelDate = models.DateField(default = timezone.now, null = True) 82 | booking_date = models.DateField(default = timezone.now) 83 | seats = models.IntegerField(default = 0) 84 | bill = models.IntegerField(default = 0) 85 | 86 | def __str__(self): 87 | return self.email 88 | -------------------------------------------------------------------------------- /db03/api/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from .models import User, BusService, HotelService, HotelBooking, BusBooking 3 | 4 | class UserSerializer(serializers.ModelSerializer): 5 | 6 | class Meta: 7 | model = User 8 | fields = ('password', 'email', 'type', 'token', 'activated', ) 9 | 10 | class BusSerializer(serializers.ModelSerializer): 11 | 12 | class Meta: 13 | model = BusService 14 | fields = ('id', 'name', 'route', 'timing', 'price', 'bus_number', 'is_ready', 'provider', 'seats', 'boarding_point', ) 15 | 16 | class HotelSerializer(serializers.ModelSerializer): 17 | 18 | class Meta: 19 | model = HotelService 20 | fields = ('id', 'name', 'city', 'area', 'check_in', 'check_out', 'price', 'is_ready', 'provider', 'rooms', 'address', 'description', ) 21 | 22 | class HotelBookingSerializer(serializers.ModelSerializer): 23 | 24 | class Meta: 25 | model = HotelBooking 26 | fields = ('id', 'service_id', 'email', 'in_date', 'out_date', 'booking_date', 'rooms', 'bill', ) 27 | 28 | class HotelBookingInfoSerializer(serializers.ModelSerializer): 29 | 30 | class Meta: 31 | model = HotelBooking 32 | fields = ('id', 'service_id', 'in_date', 'out_date', 'rooms', ) 33 | 34 | class UpdateStatusSerializer(serializers.Serializer): 35 | 36 | db_addr_1 = serializers.BooleanField() 37 | db_addr_2 = serializers.BooleanField() 38 | 39 | class BusBookingSerializer(serializers.ModelSerializer): 40 | 41 | class Meta: 42 | model = BusBooking 43 | fields = ('id', 'service_id', 'email', 'From', 'To', 'booking_date', 'seats', 'bill', 'TravelDate', ) 44 | -------------------------------------------------------------------------------- /db03/api/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /db03/api/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import path 3 | from . import views 4 | 5 | app_name = 'api' 6 | 7 | urlpatterns = [ 8 | 9 | path('user/list', views.UserList.as_view()), 10 | path('user/get', views.GetUser.as_view()), 11 | path('user/insert', views.InsertUser.as_view()), 12 | path('user/update', views.UpdateUser.as_view()), 13 | path('bus/list', views.BusServiceList.as_view()), 14 | path('bus/insert', views.NewBusService.as_view()), 15 | path('bus/delete', views.DeleteBusService.as_view()), 16 | path('bus/list/email', views.BusServiceListEmail.as_view()), 17 | path('bus/update', views.UpdateBusService.as_view()), 18 | path('bus/get', views.GetBusService.as_view()), 19 | path('hotels/list', views.HotelServiceList.as_view()), 20 | path('hotels/insert', views.NewHotelService.as_view()), 21 | path('hotels/update', views.UpdateHotelService.as_view()), 22 | path('hotels/get', views.GetHotelService.as_view()), 23 | path('hotels/delete', views.DeleteHotelService.as_view()), 24 | path('hotels/list/email', views.HotelServiceListEmail.as_view()), 25 | path('hotels/list/city', views.GetHotelByCity.as_view()), 26 | path('bookings/hotel/list', views.HotelBookingList.as_view()), 27 | path('bookings/hotel/new', views.NewHotelBooking.as_view()), 28 | path('bookings/hotel/get', views.HotelBookingByHotel.as_view()), 29 | path('bookings/hotel/user/', views.GetHotelBookingByUser.as_view()), 30 | path('bookings/hotel/id/', views.GetHotelBookingById.as_view()), 31 | path('bookings/hotel/delete', views.DeleteHotelBooking.as_view()), 32 | path('bookings/hotel/date', views.HotelBookingsByDate.as_view()), 33 | path('status', views.StatusView.as_view()), 34 | 35 | path('bus/list/city', views.GetBusByCity.as_view()), 36 | path('bookings/bus/get', views.BusBookingByBus.as_view()), 37 | path('bookings/bus/new', views.NewBusBooking.as_view()), 38 | path('bookings/bus/id/', views.GetBusBookingById.as_view()), 39 | path('bookings/bus/delete', views.DeleteBusBooking.as_view()), 40 | path('bookings/bus/user/', views.GetBusBookingByUser.as_view()), 41 | path('bookings/bus/date', views.BusBookingsByDate.as_view()), 42 | 43 | ] 44 | -------------------------------------------------------------------------------- /db03/db03/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/db03/__init__.py -------------------------------------------------------------------------------- /db03/db03/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/db03/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /db03/db03/__pycache__/settings.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/db03/__pycache__/settings.cpython-36.pyc -------------------------------------------------------------------------------- /db03/db03/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/db03/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /db03/db03/__pycache__/wsgi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db03/db03/__pycache__/wsgi.cpython-36.pyc -------------------------------------------------------------------------------- /db03/db03/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for db03 project. 3 | 4 | Generated by 'django-admin startproject' using Django 2.1.7. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/2.1/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = '!ho@iiz$&%jr#%0j#^eva0i+k3y6bv!vtq7m1g6(!4qvweyk69' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'rest_framework', 41 | 'api', 42 | ] 43 | 44 | MIDDLEWARE = [ 45 | 'django.middleware.security.SecurityMiddleware', 46 | 'django.contrib.sessions.middleware.SessionMiddleware', 47 | 'django.middleware.common.CommonMiddleware', 48 | 'django.middleware.csrf.CsrfViewMiddleware', 49 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 50 | 'django.contrib.messages.middleware.MessageMiddleware', 51 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 52 | ] 53 | 54 | ROOT_URLCONF = 'db03.urls' 55 | 56 | TEMPLATES = [ 57 | { 58 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 59 | 'DIRS': [], 60 | 'APP_DIRS': True, 61 | 'OPTIONS': { 62 | 'context_processors': [ 63 | 'django.template.context_processors.debug', 64 | 'django.template.context_processors.request', 65 | 'django.contrib.auth.context_processors.auth', 66 | 'django.contrib.messages.context_processors.messages', 67 | ], 68 | }, 69 | }, 70 | ] 71 | 72 | WSGI_APPLICATION = 'db03.wsgi.application' 73 | 74 | 75 | # Database 76 | # https://docs.djangoproject.com/en/2.1/ref/settings/#databases 77 | 78 | DATABASES = { 79 | 'default': { 80 | 'ENGINE': 'django.db.backends.postgresql_psycopg2', 81 | 'NAME': 'dumbape', 82 | 'USER': 'dumbape', 83 | 'PASSWORD': 'iiita123', 84 | 'HOST': 'localhost', 85 | 'PORT': '5443', 86 | } 87 | } 88 | 89 | 90 | # Password validation 91 | # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators 92 | 93 | AUTH_PASSWORD_VALIDATORS = [ 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 96 | }, 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 102 | }, 103 | { 104 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 105 | }, 106 | ] 107 | 108 | 109 | # Internationalization 110 | # https://docs.djangoproject.com/en/2.1/topics/i18n/ 111 | 112 | LANGUAGE_CODE = 'en-us' 113 | 114 | TIME_ZONE = 'UTC' 115 | 116 | USE_I18N = True 117 | 118 | USE_L10N = True 119 | 120 | USE_TZ = True 121 | 122 | 123 | # Static files (CSS, JavaScript, Images) 124 | # https://docs.djangoproject.com/en/2.1/howto/static-files/ 125 | 126 | STATIC_URL = '/static/' 127 | -------------------------------------------------------------------------------- /db03/db03/urls.py: -------------------------------------------------------------------------------- 1 | """db01 URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path 18 | from django.urls import include 19 | 20 | urlpatterns = [ 21 | path('admin/', admin.site.urls), 22 | path('api/', include('api.urls')), 23 | ] 24 | -------------------------------------------------------------------------------- /db03/db03/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for db03 project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'db03.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /db03/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == '__main__': 6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'db03.settings') 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError as exc: 10 | raise ImportError( 11 | "Couldn't import Django. Are you sure it's installed and " 12 | "available on your PYTHONPATH environment variable? Did you " 13 | "forget to activate a virtual environment?" 14 | ) from exc 15 | execute_from_command_line(sys.argv) 16 | -------------------------------------------------------------------------------- /db04/api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/api/__init__.py -------------------------------------------------------------------------------- /db04/api/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/api/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /db04/api/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/api/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /db04/api/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/api/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /db04/api/__pycache__/serializers.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/api/__pycache__/serializers.cpython-36.pyc -------------------------------------------------------------------------------- /db04/api/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/api/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /db04/api/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/api/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /db04/api/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | from django.contrib import admin 5 | from . import models 6 | 7 | class UserAdmin(admin.ModelAdmin): 8 | readonly_fields = ('password', 'token', 'email', ) 9 | 10 | admin.site.register(models.User) 11 | admin.site.register(models.BusService) 12 | admin.site.register(models.HotelService) 13 | admin.site.register(models.HotelBooking) 14 | admin.site.register(models.BusBooking) 15 | -------------------------------------------------------------------------------- /db04/api/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class ApiConfig(AppConfig): 5 | name = 'api' 6 | -------------------------------------------------------------------------------- /db04/api/migrations/0002_busbooking.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-29 20:03 2 | 3 | from django.db import migrations, models 4 | import django.utils.timezone 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('api', '0001_initial'), 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='BusBooking', 16 | fields=[ 17 | ('id', models.CharField(max_length=100, primary_key=True, serialize=False)), 18 | ('service_id', models.CharField(max_length=100)), 19 | ('email', models.EmailField(max_length=100)), 20 | ('From', models.CharField(default='', max_length=100)), 21 | ('To', models.CharField(default='', max_length=100)), 22 | ('TravelDate', models.DateField(default=django.utils.timezone.now, null=True)), 23 | ('booking_date', models.DateField(default=django.utils.timezone.now)), 24 | ('seats', models.IntegerField(default=0)), 25 | ('bill', models.IntegerField(default=0)), 26 | ], 27 | ), 28 | ] 29 | -------------------------------------------------------------------------------- /db04/api/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/api/migrations/__init__.py -------------------------------------------------------------------------------- /db04/api/migrations/__pycache__/0001_initial.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/api/migrations/__pycache__/0001_initial.cpython-36.pyc -------------------------------------------------------------------------------- /db04/api/migrations/__pycache__/0002_busbooking.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/api/migrations/__pycache__/0002_busbooking.cpython-36.pyc -------------------------------------------------------------------------------- /db04/api/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/api/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /db04/api/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from .models import User, BusService, HotelService, HotelBooking, BusBooking 3 | 4 | class UserSerializer(serializers.ModelSerializer): 5 | 6 | class Meta: 7 | model = User 8 | fields = ('password', 'email', 'type', 'token', 'activated', ) 9 | 10 | class BusSerializer(serializers.ModelSerializer): 11 | 12 | class Meta: 13 | model = BusService 14 | fields = ('id', 'name', 'route', 'timing', 'price', 'bus_number', 'is_ready', 'provider', 'seats', 'boarding_point', ) 15 | 16 | class HotelSerializer(serializers.ModelSerializer): 17 | 18 | class Meta: 19 | model = HotelService 20 | fields = ('id', 'name', 'city', 'area', 'check_in', 'check_out', 'price', 'is_ready', 'provider', 'rooms', 'address', 'description', ) 21 | 22 | class HotelBookingSerializer(serializers.ModelSerializer): 23 | 24 | class Meta: 25 | model = HotelBooking 26 | fields = ('id', 'service_id', 'email', 'in_date', 'out_date', 'booking_date', 'rooms', 'bill', ) 27 | 28 | class HotelBookingInfoSerializer(serializers.ModelSerializer): 29 | 30 | class Meta: 31 | model = HotelBooking 32 | fields = ('id', 'service_id', 'in_date', 'out_date', 'rooms', ) 33 | 34 | class UpdateStatusSerializer(serializers.Serializer): 35 | 36 | db_addr_1 = serializers.BooleanField() 37 | db_addr_2 = serializers.BooleanField() 38 | 39 | class BusBookingSerializer(serializers.ModelSerializer): 40 | 41 | class Meta: 42 | model = BusBooking 43 | fields = ('id', 'service_id', 'email', 'From', 'To', 'booking_date', 'seats', 'bill', 'TravelDate', ) 44 | -------------------------------------------------------------------------------- /db04/api/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /db04/api/urls.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from django.urls import path 3 | from . import views 4 | 5 | app_name = 'api' 6 | 7 | urlpatterns = [ 8 | 9 | path('user/list', views.UserList.as_view()), 10 | path('user/get', views.GetUser.as_view()), 11 | path('user/insert', views.InsertUser.as_view()), 12 | path('user/update', views.UpdateUser.as_view()), 13 | path('bus/list', views.BusServiceList.as_view()), 14 | path('bus/insert', views.NewBusService.as_view()), 15 | path('bus/delete', views.DeleteBusService.as_view()), 16 | path('bus/list/email', views.BusServiceListEmail.as_view()), 17 | path('bus/update', views.UpdateBusService.as_view()), 18 | path('bus/get', views.GetBusService.as_view()), 19 | path('hotels/list', views.HotelServiceList.as_view()), 20 | path('hotels/insert', views.NewHotelService.as_view()), 21 | path('hotels/update', views.UpdateHotelService.as_view()), 22 | path('hotels/get', views.GetHotelService.as_view()), 23 | path('hotels/delete', views.DeleteHotelService.as_view()), 24 | path('hotels/list/email', views.HotelServiceListEmail.as_view()), 25 | path('hotels/list/city', views.GetHotelByCity.as_view()), 26 | path('bookings/hotel/list', views.HotelBookingList.as_view()), 27 | path('bookings/hotel/new', views.NewHotelBooking.as_view()), 28 | path('bookings/hotel/get', views.HotelBookingByHotel.as_view()), 29 | path('bookings/hotel/user/', views.GetHotelBookingByUser.as_view()), 30 | path('bookings/hotel/id/', views.GetHotelBookingById.as_view()), 31 | path('bookings/hotel/delete', views.DeleteHotelBooking.as_view()), 32 | path('bookings/hotel/date', views.HotelBookingsByDate.as_view()), 33 | path('status', views.StatusView.as_view()), 34 | 35 | path('bus/list/city', views.GetBusByCity.as_view()), 36 | path('bookings/bus/get', views.BusBookingByBus.as_view()), 37 | path('bookings/bus/new', views.NewBusBooking.as_view()), 38 | path('bookings/bus/id/', views.GetBusBookingById.as_view()), 39 | path('bookings/bus/delete', views.DeleteBusBooking.as_view()), 40 | path('bookings/bus/user/', views.GetBusBookingByUser.as_view()), 41 | path('bookings/bus/date', views.BusBookingsByDate.as_view()), 42 | 43 | ] 44 | -------------------------------------------------------------------------------- /db04/db04/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/db04/__init__.py -------------------------------------------------------------------------------- /db04/db04/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/db04/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /db04/db04/__pycache__/settings.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/db04/__pycache__/settings.cpython-36.pyc -------------------------------------------------------------------------------- /db04/db04/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/db04/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /db04/db04/__pycache__/wsgi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/db04/db04/__pycache__/wsgi.cpython-36.pyc -------------------------------------------------------------------------------- /db04/db04/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for db04 project. 3 | 4 | Generated by 'django-admin startproject' using Django 2.1.7. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/2.1/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = 'ko1q-_@6l!j*+hegg054q_3t72ymf(h!wwa0t0q*yuup$kl^u9' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'rest_framework', 41 | 'api', 42 | ] 43 | 44 | MIDDLEWARE = [ 45 | 'django.middleware.security.SecurityMiddleware', 46 | 'django.contrib.sessions.middleware.SessionMiddleware', 47 | 'django.middleware.common.CommonMiddleware', 48 | 'django.middleware.csrf.CsrfViewMiddleware', 49 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 50 | 'django.contrib.messages.middleware.MessageMiddleware', 51 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 52 | ] 53 | 54 | ROOT_URLCONF = 'db04.urls' 55 | 56 | TEMPLATES = [ 57 | { 58 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 59 | 'DIRS': [], 60 | 'APP_DIRS': True, 61 | 'OPTIONS': { 62 | 'context_processors': [ 63 | 'django.template.context_processors.debug', 64 | 'django.template.context_processors.request', 65 | 'django.contrib.auth.context_processors.auth', 66 | 'django.contrib.messages.context_processors.messages', 67 | ], 68 | }, 69 | }, 70 | ] 71 | 72 | WSGI_APPLICATION = 'db04.wsgi.application' 73 | 74 | 75 | # Database 76 | # https://docs.djangoproject.com/en/2.1/ref/settings/#databases 77 | 78 | DATABASES = { 79 | 'default': { 80 | 'ENGINE': 'django.db.backends.postgresql_psycopg2', 81 | 'NAME': 'dumbape', 82 | 'USER': 'dumbape', 83 | 'PASSWORD': 'iiita123', 84 | 'HOST': 'localhost', 85 | 'PORT': '5444', 86 | } 87 | } 88 | 89 | 90 | # Password validation 91 | # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators 92 | 93 | AUTH_PASSWORD_VALIDATORS = [ 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 96 | }, 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 102 | }, 103 | { 104 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 105 | }, 106 | ] 107 | 108 | 109 | # Internationalization 110 | # https://docs.djangoproject.com/en/2.1/topics/i18n/ 111 | 112 | LANGUAGE_CODE = 'en-us' 113 | 114 | TIME_ZONE = 'UTC' 115 | 116 | USE_I18N = True 117 | 118 | USE_L10N = True 119 | 120 | USE_TZ = True 121 | 122 | 123 | # Static files (CSS, JavaScript, Images) 124 | # https://docs.djangoproject.com/en/2.1/howto/static-files/ 125 | 126 | STATIC_URL = '/static/' 127 | -------------------------------------------------------------------------------- /db04/db04/urls.py: -------------------------------------------------------------------------------- 1 | """db01 URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path 18 | from django.urls import include 19 | 20 | urlpatterns = [ 21 | path('admin/', admin.site.urls), 22 | path('api/', include('api.urls')), 23 | ] 24 | -------------------------------------------------------------------------------- /db04/db04/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for db04 project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'db04.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /db04/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == '__main__': 6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'db04.settings') 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError as exc: 10 | raise ImportError( 11 | "Couldn't import Django. Are you sure it's installed and " 12 | "available on your PYTHONPATH environment variable? Did you " 13 | "forget to activate a virtual environment?" 14 | ) from exc 15 | execute_from_command_line(sys.argv) 16 | -------------------------------------------------------------------------------- /instructions.txt: -------------------------------------------------------------------------------- 1 | INSTALLING POSTGRES: 2 | 3 | sudo apt install postgresql postgresql-contrib 4 | 5 | SETTING UP MULTIPLE INSTANCES OF THE DATABASE: 6 | 7 | 1. Create 5 new folders - primary, db01, db02, db03, db04, db05 (preferable in the directory /usr/local/postgres/) 8 | 9 | 2. Create clusters: 10 | 11 | Run the following commands: 12 | 13 | sudo chown -R /var/run/postgresql/ 14 | cd /usr/lib/postgresql/10/bin/ 15 | ./initdb -D -U -W 16 | 17 | run the last command for each of the created folders to set up a database in each of them. 18 | 19 | 3. Start the database server at ports 5440, 5441, 5442, 5443, 5444 respectively. 20 | 21 | pg_ctl -D -o "-p 5440" start 22 | pg_ctl -D -o "-p 5441" start 23 | pg_ctl -D -o "-p 5442" start 24 | pg_ctl -D -o "-p 5443" start 25 | pg_ctl -D -o "-p 5444" start 26 | 27 | INSTALLATION AND RUNNING THE PROJECT: 28 | 29 | 1. (Optional) Make sure Virtual Environment is installed in the system. Create a new virtual environment in the project directory and switch to the virtual environment. 30 | 2. Run command -> pip install -r requirements.txt 31 | 3. Start the servers: (each command in a different terminal switched to the virtual environment) 32 | 33 | python db01/manage.py runserver 9001 34 | python db02/manage.py runserver 9002 35 | python db03/manage.py runserver 9003 36 | python db04/manage.py runserver 9004 37 | python server/manage.py runserver 9000 38 | 39 | 4. Create superuser: python server/manage.py createsuperuser 40 | Enter valid details. 41 | 42 | 5. Goto 127.0.0.1:9000/admin and login as the superuser. 43 | 6. Goto the model database details and enter all database details. 44 | 7. Goto 127.0.0.1:9000/login 45 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2019.3.9 2 | chardet==3.0.4 3 | Django==2.1.7 4 | django-widget-tweaks==1.4.3 5 | djangorestframework==3.9.2 6 | idna==2.8 7 | psycopg2==2.7.7 8 | psycopg2-binary==2.7.7 9 | Pygments==2.3.1 10 | pytz==2018.9 11 | requests==2.21.0 12 | urllib3==1.24.1 13 | -------------------------------------------------------------------------------- /server/accounts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/accounts/__init__.py -------------------------------------------------------------------------------- /server/accounts/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/accounts/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /server/accounts/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/accounts/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /server/accounts/__pycache__/authentication.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/accounts/__pycache__/authentication.cpython-36.pyc -------------------------------------------------------------------------------- /server/accounts/__pycache__/forms.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/accounts/__pycache__/forms.cpython-36.pyc -------------------------------------------------------------------------------- /server/accounts/__pycache__/mail.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/accounts/__pycache__/mail.cpython-36.pyc -------------------------------------------------------------------------------- /server/accounts/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/accounts/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /server/accounts/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/accounts/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /server/accounts/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/accounts/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /server/accounts/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /server/accounts/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AccountsConfig(AppConfig): 5 | name = 'accounts' 6 | -------------------------------------------------------------------------------- /server/accounts/authentication.py: -------------------------------------------------------------------------------- 1 | def is_authenticated(request): 2 | return request.session.get('email') 3 | 4 | def get_type(request): 5 | return request.session.get('type') 6 | -------------------------------------------------------------------------------- /server/accounts/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from database import models 3 | from django.core import validators 4 | 5 | class LoginForm(forms.Form): 6 | email = forms.EmailField(max_length = 100, required = True) 7 | password = forms.CharField(max_length = 100, required = True) 8 | 9 | class SignupForm(forms.Form): 10 | email = forms.EmailField(max_length = 100, required = True) 11 | password = forms.CharField(max_length = 100, required = True) 12 | password_cnf = forms.CharField(max_length = 100, required = True) 13 | 14 | def get_object(self, email): 15 | return models.UserMetaData.objects.filter(email = email) 16 | 17 | def clean_email(self): 18 | email = self.cleaned_data['email'] 19 | try: 20 | v = validators.validate_email(email) 21 | except: 22 | raise forms.ValidationError("Enter a valid email address") 23 | 24 | try: 25 | user = self.get_object(email) 26 | if user.count() > 0: 27 | raise forms.ValidationError("User already exists") 28 | else: 29 | return email 30 | except Exception as e: 31 | raise e 32 | 33 | def clean_password_cnf(self): 34 | pass1 = self.cleaned_data['password'] 35 | pass2 = self.cleaned_data['password_cnf'] 36 | if len(pass1) == 0 or len(pass2) == 0: 37 | raise forms.ValidationError("Fields cannot be empty") 38 | elif pass1 != pass2: 39 | raise forms.ValidationError("Passwords do not match") 40 | else: 41 | return pass1 42 | 43 | class ForgotForm(forms.Form): 44 | email = forms.EmailField(max_length = 100, required = True) 45 | 46 | def get_object(self, email): 47 | return models.UserMetaData.objects.filter(email = email) 48 | 49 | def clean_email(self): 50 | email = self.cleaned_data['email'] 51 | user = self.get_object(email) 52 | if user.count() > 0: 53 | return email 54 | else: 55 | raise forms.ValidationError("Email not registered") 56 | 57 | class PasswordResetForm(forms.Form): 58 | password = forms.CharField(max_length = 100, required = True) 59 | password_cnf = forms.CharField(max_length = 100, required = True) 60 | 61 | def clean_password_cnf(self): 62 | pass1 = self.cleaned_data['password'] 63 | pass2 = self.cleaned_data['password_cnf'] 64 | if len(pass1) == 0 or len(pass2) == 0: 65 | raise forms.ValidationError("Fields cannot be empty") 66 | elif pass1 != pass2: 67 | raise forms.ValidationError("Passwords do not match") 68 | else: 69 | return pass1 70 | -------------------------------------------------------------------------------- /server/accounts/mail.py: -------------------------------------------------------------------------------- 1 | from django.core.mail import EmailMessage 2 | from django.utils import http 3 | from django.urls import reverse 4 | 5 | WEBSITE = '127.0.0.1:9000' 6 | 7 | def sendUserRegisteredMail(name, email, token): 8 | Subject = 'Welcome to MCQTS' 9 | Body = 'Hello, ' + name + '

' + 'Thankyou for registering at MCQTS. Your new account has been created. You may login after activating your account. Click the link to activate your account:
' 10 | Body += '
Link: ' + 'http://localhost:8000' + reverse('accounts:activate') + '?id='+ http.urlquote_plus(email) +'&token='+ http.urlquote_plus(token) 11 | Body += '

This is an automatically generated email. Do not reply back.

' 12 | Body += 'Regards
MCQTS' 13 | email = EmailMessage(Subject, Body, to=[email,]) 14 | email.content_subtype = "html" 15 | return email.send() 16 | 17 | def sendUserForgotMail(email, token): 18 | Subject = 'Login Details - Travel Agency' 19 | Body = 'Hello,

' + 'You had requested to reset your password at Online Travel Agency.' 20 | Body += '
To reset your password, click on the link: ' + WEBSITE + reverse('accounts:Reset') + '?id='+ http.urlquote_plus(email) +'&token='+ http.urlquote_plus(token) 21 | Body += '

This is an automatically generated email. Do not reply back.

' 22 | Body += 'Regards
Travel Agency' 23 | email = EmailMessage(Subject, Body, to=[email,]) 24 | email.content_subtype = "html" 25 | return email.send() 26 | -------------------------------------------------------------------------------- /server/accounts/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/accounts/migrations/__init__.py -------------------------------------------------------------------------------- /server/accounts/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/accounts/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /server/accounts/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | -------------------------------------------------------------------------------- /server/accounts/templates/accounts/base.html: -------------------------------------------------------------------------------- 1 | {% load staticfiles %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | {% block title_block %}{% endblock %} 9 | 10 | 11 | 12 | 13 | 42 | 43 |
44 |
45 |
46 | {% block form_block %}{% endblock %} 47 |
48 |
49 |
50 | 51 | 52 | -------------------------------------------------------------------------------- /server/accounts/templates/accounts/forgot.html: -------------------------------------------------------------------------------- 1 | {% extends 'accounts/base.html' %} 2 | {% load widget_tweaks %} 3 | 4 | {% block title_block %}Forgot{% endblock %} 5 | 6 | {% block form_block %} 7 | 8 |
9 |

Retrieve Account

10 |

Enter your email address

11 |
12 |
13 | {% csrf_token %} 14 |
15 |
16 | {% render_field form.email type="text" class="input is-medium" placeholder="Your Email" %} 17 |
18 |
19 | 20 |
21 |
22 |
23 | Login  ·  24 | Sign Up  ·  25 |
26 | 27 |
28 | {% if error %} 29 |
30 | {{ msg }} 31 |
32 | {% endif %} 33 | {% if form_err %} 34 | {% for field in form %} 35 | {% if field.errors %} 36 |
{{ field.errors | striptags }}
37 | {% endif %} 38 | {% endfor %} 39 | {% endif %} 40 | {% if success %} 41 |
{{ msg }}
42 | {% endif %} 43 |
44 | 45 |
46 | 47 | {% endblock %} 48 | -------------------------------------------------------------------------------- /server/accounts/templates/accounts/login.html: -------------------------------------------------------------------------------- 1 | {% extends 'accounts/base.html' %} 2 | {% load widget_tweaks %} 3 | 4 | {% block title_block %}Login{% endblock %} 5 | 6 | {% block form_block %} 7 | 8 |
9 |

Login

10 |

Please login to proceed.

11 |
12 |
13 | {% csrf_token %} 14 |
15 |
16 | {% render_field form.email type="text" class="input is-medium" placeholder="Your Email" %} 17 |
18 |
19 |
20 |
21 | {% render_field form.password type="password" class="input is-medium" placeholder="Your Password" %} 22 |
23 |
24 | 25 |
26 |
27 |
28 | Sign Up  ·  29 | Forgot Password  ·  30 |
31 | 32 |
33 | {% if error %} 34 |
35 | {{ msg }} 36 |
37 | {% endif %} 38 |
39 | 40 |
41 | 42 | {% endblock %} 43 | -------------------------------------------------------------------------------- /server/accounts/templates/accounts/reset.html: -------------------------------------------------------------------------------- 1 | {% extends 'accounts/base.html' %} 2 | {% load widget_tweaks %} 3 | 4 | {% block title_block %}Forgot{% endblock %} 5 | 6 | {% block form_block %} 7 | 8 |
9 |

Retrieve Account

10 |

Enter your email address

11 |
12 |
13 | {% csrf_token %} 14 |
15 |
16 | {% render_field form.password type="password" class="input is-medium" placeholder="Password" %} 17 |
18 |
19 |
20 |
21 | {% render_field form.password_cnf type="password" class="input is-medium" placeholder="Confirm Password" %} 22 |
23 |
24 | 25 |
26 |
27 |
28 | Login  ·  29 | Sign Up  ·  30 |
31 | 32 |
33 | {% if error %} 34 |
35 | {{ msg }} 36 |
37 | {% endif %} 38 | {% if form_err %} 39 | {% for field in form %} 40 | {% if field.errors %} 41 |
{{ field.errors | striptags }}
42 | {% endif %} 43 | {% endfor %} 44 | {% endif %} 45 | {% if success %} 46 |
{{ msg }}
47 | {% endif %} 48 |
49 | 50 |
51 | 52 | {% endblock %} 53 | -------------------------------------------------------------------------------- /server/accounts/templates/accounts/reset_done.html: -------------------------------------------------------------------------------- 1 | {% extends 'accounts/base.html' %} 2 | {% load widget_tweaks %} 3 | 4 | {% block title_block %}Forgot{% endblock %} 5 | 6 | {% block form_block %} 7 | 8 |
9 |

Password Changed

10 |
11 |
12 | Your password has been changed. Login to proceed. 13 |
14 |
15 |
16 | Login 17 |
18 | 19 | 20 | 21 |
22 | 23 | {% endblock %} 24 | -------------------------------------------------------------------------------- /server/accounts/templates/accounts/signup.html: -------------------------------------------------------------------------------- 1 | {% extends 'accounts/base.html' %} 2 | {% load widget_tweaks %} 3 | 4 | {% block title_block %}Sign Up{% endblock %} 5 | 6 | {% block form_block %} 7 | 8 |
9 |

Sign Up

10 |

Register your account

11 |
12 |
13 | {% csrf_token %} 14 |
15 |
16 | {% render_field form.email type="email" class="input is-medium" placeholder="Email" %} 17 |
18 |
19 |
20 |
21 | {% render_field form.password type="password" class="input is-medium" placeholder="Password" %} 22 |
23 |
24 |
25 |
26 | {% render_field form.password_cnf type="password" class="input is-medium" placeholder="Confirm Password" %} 27 |
28 |
29 | 30 |
31 |
32 |
33 | Login  ·  34 | Forgot Password  ·  35 |
36 | 37 |
38 | {% if error %} 39 |
40 | {{ msg }} 41 |
42 | {% endif %} 43 | {% if form_err %} 44 | {% for field in form %} 45 | {% if field.errors %} 46 |
{{ field.errors | striptags }}
47 | {% endif %} 48 | {% endfor %} 49 | {% endif %} 50 | {% if success %} 51 |
{{ msg }}
52 | {% endif %} 53 |
54 | 55 |
56 | 57 | {% endblock %} 58 | -------------------------------------------------------------------------------- /server/accounts/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /server/accounts/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | app_name = 'accounts' 5 | 6 | urlpatterns = [ 7 | 8 | path('login', views.LoginView.as_view(), name = 'Login'), 9 | path('register', views.SignupView.as_view(), name = 'Signup'), 10 | path('forgot', views.ForgotView.as_view(), name = 'Forgot'), 11 | path('reset', views.PasswordResetView.as_view(), name = 'Reset'), 12 | 13 | ] 14 | -------------------------------------------------------------------------------- /server/booking/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/booking/__init__.py -------------------------------------------------------------------------------- /server/booking/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/booking/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /server/booking/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/booking/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /server/booking/__pycache__/forms.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/booking/__pycache__/forms.cpython-36.pyc -------------------------------------------------------------------------------- /server/booking/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/booking/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /server/booking/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/booking/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /server/booking/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/booking/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /server/booking/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /server/booking/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BookingConfig(AppConfig): 5 | name = 'booking' 6 | -------------------------------------------------------------------------------- /server/booking/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from database import utils, models 3 | from django.utils.crypto import get_random_string 4 | 5 | class DeleteBookingForm(forms.Form): 6 | password = forms.CharField(required = True, max_length = 100) 7 | -------------------------------------------------------------------------------- /server/booking/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/booking/migrations/__init__.py -------------------------------------------------------------------------------- /server/booking/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/booking/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /server/booking/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /server/booking/templates/booking/past_buses.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load widget_tweaks %} 3 | 4 | {% block service_block %}{% if type != 'S' %}style="visibilty: hidden; display: none;"{% endif %}{% endblock %} 5 | {% block admin_block %}{% if type != 'A' %}style="visibilty: hidden; display: none;"{% endif %}{% endblock %} 6 | 7 | {% block title_block %}Past Trips{% endblock %} 8 | 9 | {% block content_block %} 10 | 11 |
12 | 13 |

PAST TRIPS

14 | 15 |
16 |
17 | 21 |
22 |
23 | 26 |
27 |
28 | 29 |
30 |
31 |
Bus Bookings
32 | 33 | {% if bus_bookings|length == 0 %} 34 |
35 | NO BOOKINGS TO SHOW 36 |
37 | {% endif %} 38 | 39 | {% for booking in bus_bookings %} 40 |
41 |
42 | 43 |
44 |
45 | 48 |
49 |
50 |
51 | {{ booking.seats }} seats 52 |
53 |
54 |
55 |
56 | {{ booking.From }}   to   {{ booking.To }} 57 |
58 |
59 |
60 |
61 | {{ booking.TravelDate }} 62 |
63 |
64 | 69 |
70 |
71 |
72 | {% endfor %} 73 |
74 |
75 |
76 | 77 | {% endblock %} 78 | -------------------------------------------------------------------------------- /server/booking/templates/booking/past_hotels.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load widget_tweaks %} 3 | 4 | {% block service_block %}{% if type != 'S' %}style="visibilty: hidden; display: none;"{% endif %}{% endblock %} 5 | {% block admin_block %}{% if type != 'A' %}style="visibilty: hidden; display: none;"{% endif %}{% endblock %} 6 | 7 | {% block title_block %}Past Trips{% endblock %} 8 | 9 | {% block content_block %} 10 | 11 |
12 | 13 |

PAST TRIPS

14 | 15 |
16 |
17 | 21 |
22 |
23 | 26 |
27 |
28 | 29 |
30 |
31 |
Hotel Bookings
32 | 33 | {% if hotel_bookings|length == 0 %} 34 |
35 | NO BOOKINGS TO SHOW 36 |
37 | {% endif %} 38 | 39 | {% for hotel in hotel_bookings %} 40 |
41 |
42 | 43 |
44 |
45 | 48 |
49 |
50 |
51 | {{ hotel.rooms }} rooms 52 |
53 |
54 |
55 |
56 | {{ hotel.in_date }}   to   {{ hotel.out_date }} 57 |
58 |
59 | 64 |
65 |
66 |
67 | {% endfor %} 68 |
69 |
70 |
71 | 72 | {% endblock %} 73 | -------------------------------------------------------------------------------- /server/booking/templates/booking/upcoming_buses.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load widget_tweaks %} 3 | 4 | {% block service_block %}{% if type != 'S' %}style="visibilty: hidden; display: none;"{% endif %}{% endblock %} 5 | {% block admin_block %}{% if type != 'A' %}style="visibilty: hidden; display: none;"{% endif %}{% endblock %} 6 | 7 | {% block title_block %}Upcoming Trips{% endblock %} 8 | 9 | {% block content_block %} 10 | 11 |
12 | 13 |

UPCOMING TRIPS

14 | 15 |
16 |
17 | 21 |
22 |
23 | 26 |
27 |
28 | 29 |
30 |
31 |
Bus Bookings
32 | 33 | {% if bus_bookings|length == 0 %} 34 |
35 | NO BOOKINGS TO SHOW 36 |
37 | {% endif %} 38 | 39 | {% for booking in bus_bookings %} 40 |
41 |
42 | 43 |
44 |
45 | 48 |
49 |
50 |
51 | {{ booking.seats }} seats 52 |
53 |
54 |
55 |
56 | {{ booking.From }}   to   {{ booking.To }} 57 |
58 |
59 |
60 |
61 | {{ booking.TravelDate }} 62 |
63 |
64 | 69 |
70 |
71 |
72 | {% endfor %} 73 |
74 |
75 |
76 | 77 | {% endblock %} 78 | -------------------------------------------------------------------------------- /server/booking/templates/booking/upcoming_hotels.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load widget_tweaks %} 3 | 4 | {% block service_block %}{% if type != 'S' %}style="visibilty: hidden; display: none;"{% endif %}{% endblock %} 5 | {% block admin_block %}{% if type != 'A' %}style="visibilty: hidden; display: none;"{% endif %}{% endblock %} 6 | 7 | {% block title_block %}Upcoming Trips{% endblock %} 8 | 9 | {% block content_block %} 10 | 11 |
12 | 13 |

UPCOMING TRIPS

14 | 15 |
16 |
17 | 21 |
22 |
23 | 26 |
27 |
28 | 29 |
30 |
31 |
Hotel Bookings
32 | 33 | {% if hotel_bookings|length == 0 %} 34 |
35 | NO BOOKINGS TO SHOW 36 |
37 | {% endif %} 38 | 39 | {% for hotel in hotel_bookings %} 40 |
41 |
42 | 43 |
44 |
45 | 48 |
49 |
50 |
51 | {{ hotel.rooms }} rooms 52 |
53 |
54 |
55 |
56 | {{ hotel.in_date }}   to   {{ hotel.out_date }} 57 |
58 |
59 | 64 |
65 |
66 |
67 | {% endfor %} 68 |
69 |
70 |
71 | 72 | {% endblock %} 73 | -------------------------------------------------------------------------------- /server/booking/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /server/booking/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | app_name = 'booking' 5 | 6 | urlpatterns = [ 7 | 8 | path('upcoming', views.UpcomingView.as_view(), name = 'Upcoming'), 9 | path('past', views.PastView.as_view(), name = 'Past'), 10 | path('view/', views.BookingDetailView.as_view(), name = 'Detail'), 11 | 12 | ] 13 | -------------------------------------------------------------------------------- /server/buses/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/buses/__init__.py -------------------------------------------------------------------------------- /server/buses/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/buses/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /server/buses/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/buses/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /server/buses/__pycache__/forms.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/buses/__pycache__/forms.cpython-36.pyc -------------------------------------------------------------------------------- /server/buses/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/buses/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /server/buses/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/buses/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /server/buses/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/buses/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /server/buses/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /server/buses/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BusesConfig(AppConfig): 5 | name = 'buses' 6 | -------------------------------------------------------------------------------- /server/buses/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from database import utils, models 3 | from django.utils.crypto import get_random_string 4 | 5 | class BusSearchForm(forms.Form): 6 | From = forms.CharField(max_length = 100, required = True) 7 | To = forms.CharField(max_length = 100, required = True) 8 | TravelDate = forms.DateField(required = True) 9 | 10 | class BusBookForm(forms.Form): 11 | From = forms.CharField(max_length = 50, required = True) 12 | To = forms.CharField(max_length = 50, required = True) 13 | TravelDate = forms.CharField(max_length = 50, required = True) 14 | seats = forms.IntegerField(required = True) 15 | available = forms.IntegerField(required = True, widget = forms.HiddenInput()) 16 | 17 | class DateForm(forms.Form): 18 | date = forms.DateField(required = True) 19 | -------------------------------------------------------------------------------- /server/buses/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/buses/migrations/__init__.py -------------------------------------------------------------------------------- /server/buses/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/buses/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /server/buses/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /server/buses/templates/buses/search.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load widget_tweaks %} 3 | 4 | {% block service_block %}{% if type != 'S' %}style="visibilty: hidden; display: none;"{% endif %}{% endblock %} 5 | {% block admin_block %}{% if type != 'A' %}style="visibilty: hidden; display: none;"{% endif %}{% endblock %} 6 | 7 | {% block title_block %}Search Buses{% endblock %} 8 | 9 | {% block content_block %} 10 | 11 |
12 | 13 |
14 | SEARCH BUSES 15 |
16 |
17 |
18 |
19 |
20 | {% csrf_token %} 21 |
22 |
23 | 24 |
25 |
26 |
27 |
28 | {% render_field form.From type="text" class="input is-rounded" placeholder="From" %} 29 |
30 |
31 |
32 |
33 | {% render_field form.To type="text" class="input is-rounded" placeholder="To" %} 34 |
35 |
36 |
37 |
38 |
39 |
40 | 41 |
42 |
43 |
44 |
45 | {% render_field form.TravelDate type="date" class="input is-rounded" placeholder="Date" %} 46 |
47 |
48 |
49 |
50 |
51 |
52 | 53 |
54 |
55 |
56 | 57 |
58 | {% if error %} 59 |
60 |
61 |

{{ msg }}

62 |
63 |
64 | {% else %} 65 |
66 |
67 |

Enter Destination and Dates to Search Buses

68 |
69 |
70 | {% endif %} 71 |
72 | 73 |
74 |
75 |
76 | 77 |
78 | 79 | {% endblock %} 80 | -------------------------------------------------------------------------------- /server/buses/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /server/buses/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | app_name = 'buses' 5 | 6 | urlpatterns = [ 7 | 8 | path('buses', views.BusSearchView.as_view(), name = 'Search'), 9 | path('buses/list', views.BusDisplayView.as_view(), name = 'Display'), 10 | path('buses/view/', views.BusDetailsView.as_view(), name = 'Details'), 11 | path('buses/bookings/', views.BusBookingListView.as_view(), name = 'Bookings'), 12 | 13 | ] 14 | -------------------------------------------------------------------------------- /server/database/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/__init__.py -------------------------------------------------------------------------------- /server/database/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/__pycache__/utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/__pycache__/utils.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from . import models 3 | 4 | class PendingUpdatesAdmin(admin.ModelAdmin): 5 | fields = ('addr', 'type', 'timestamp', 'db_name', 'data_string_keys', 'data_string_values', 'data_time_keys', 'data_time_values', 'data_date_keys', 'data_date_values', 'data_boolean_keys', 'data_boolean_values', 'data_int_keys', 'data_int_values',) 6 | readonly_fields = ('timestamp',) 7 | 8 | admin.site.register(models.DatabaseDetails) 9 | admin.site.register(models.UserMetaData) 10 | admin.site.register(models.ServiceMetaData) 11 | admin.site.register(models.BookingMetaData) 12 | admin.site.register(models.HeartBeatRate) 13 | admin.site.register(models.PendingUpdates, PendingUpdatesAdmin) 14 | -------------------------------------------------------------------------------- /server/database/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class DatabaseConfig(AppConfig): 5 | name = 'database' 6 | -------------------------------------------------------------------------------- /server/database/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-09 20:16 2 | 3 | import database.models 4 | import django.contrib.postgres.fields 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='DatabaseDetails', 18 | fields=[ 19 | ('name', models.CharField(max_length=50, primary_key=True, serialize=False)), 20 | ('ip_addr', models.CharField(max_length=20)), 21 | ('port', models.CharField(max_length=8)), 22 | ('size', models.IntegerField(default=0)), 23 | ], 24 | ), 25 | migrations.CreateModel( 26 | name='ServiceMetaData', 27 | fields=[ 28 | ('id', models.CharField(max_length=64, primary_key=True, serialize=False)), 29 | ('name', models.CharField(max_length=100)), 30 | ('type', models.CharField(choices=[('B', 'Bus'), ('H', 'Hotel')], max_length=1)), 31 | ('db_name', models.CharField(max_length=50)), 32 | ('provider', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=100), default=database.models.ServiceMetaData.default_array_field, size=None)), 33 | ('capacity', models.IntegerField(default=0)), 34 | ], 35 | ), 36 | migrations.CreateModel( 37 | name='UserMetaData', 38 | fields=[ 39 | ('email', models.EmailField(max_length=100, primary_key=True, serialize=False)), 40 | ('db_name', models.CharField(max_length=50)), 41 | ], 42 | ), 43 | ] 44 | -------------------------------------------------------------------------------- /server/database/migrations/0002_remove_servicemetadata_capacity.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-09 21:00 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='servicemetadata', 15 | name='capacity', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /server/database/migrations/0003_servicemetadata_capacity.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-10 15:07 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0002_remove_servicemetadata_capacity'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='servicemetadata', 15 | name='capacity', 16 | field=models.IntegerField(default=0), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /server/database/migrations/0004_bookingmetadata.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-11 21:51 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0003_servicemetadata_capacity'), 10 | ] 11 | 12 | operations = [ 13 | migrations.CreateModel( 14 | name='BookingMetaData', 15 | fields=[ 16 | ('id', models.CharField(max_length=64, primary_key=True, serialize=False)), 17 | ('type', models.CharField(choices=[('B', 'Bus'), ('H', 'Hotel')], max_length=1)), 18 | ('db_name', models.CharField(max_length=50)), 19 | ('start_date', models.DateField()), 20 | ], 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /server/database/migrations/0005_databasedetails_status.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-24 17:18 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0004_bookingmetadata'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='databasedetails', 15 | name='status', 16 | field=models.CharField(default='', max_length=20, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /server/database/migrations/0006_auto_20190425_0019.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-25 00:19 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0005_databasedetails_status'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='usermetadata', 15 | name='db_name_1', 16 | field=models.CharField(default='', max_length=50), 17 | ), 18 | migrations.AddField( 19 | model_name='usermetadata', 20 | name='db_name_2', 21 | field=models.CharField(default='', max_length=50), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /server/database/migrations/0007_auto_20190425_1006.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-25 10:06 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0006_auto_20190425_0019'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='servicemetadata', 15 | name='db_name_1', 16 | field=models.CharField(default='', max_length=50), 17 | ), 18 | migrations.AddField( 19 | model_name='servicemetadata', 20 | name='db_name_2', 21 | field=models.CharField(default='', max_length=50), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /server/database/migrations/0008_servicemetadata_db_name_0.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-25 10:17 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0007_auto_20190425_1006'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='servicemetadata', 15 | name='db_name_0', 16 | field=models.CharField(default='', max_length=50), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /server/database/migrations/0009_auto_20190425_1044.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-25 10:44 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0008_servicemetadata_db_name_0'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='servicemetadata', 15 | name='updated_0', 16 | field=models.BooleanField(default=True), 17 | ), 18 | migrations.AddField( 19 | model_name='servicemetadata', 20 | name='updated_1', 21 | field=models.BooleanField(default=True), 22 | ), 23 | migrations.AddField( 24 | model_name='servicemetadata', 25 | name='updated_2', 26 | field=models.BooleanField(default=True), 27 | ), 28 | ] 29 | -------------------------------------------------------------------------------- /server/database/migrations/0010_pendingupdates.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-26 18:19 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0009_auto_20190425_1044'), 10 | ] 11 | 12 | operations = [ 13 | migrations.CreateModel( 14 | name='PendingUpdates', 15 | fields=[ 16 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 17 | ('data', models.CharField(max_length=3000)), 18 | ('addr', models.CharField(max_length=100)), 19 | ('type', models.CharField(choices=[('POST', 'POST'), ('GET', 'GET'), ('PUT', 'PUT')], max_length=4)), 20 | ], 21 | ), 22 | ] 23 | -------------------------------------------------------------------------------- /server/database/migrations/0011_pendingupdates_timestamp.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-26 18:34 2 | 3 | from django.db import migrations, models 4 | import django.utils.timezone 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('database', '0010_pendingupdates'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AddField( 15 | model_name='pendingupdates', 16 | name='timestamp', 17 | field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now), 18 | preserve_default=False, 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /server/database/migrations/0012_pendingupdates_db_name.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-26 19:32 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0011_pendingupdates_timestamp'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='pendingupdates', 15 | name='db_name', 16 | field=models.CharField(default='', max_length=20), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /server/database/migrations/0013_auto_20190426_2159.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-26 21:59 2 | 3 | import database.models 4 | import django.contrib.postgres.fields 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('database', '0012_pendingupdates_db_name'), 12 | ] 13 | 14 | operations = [ 15 | migrations.RemoveField( 16 | model_name='pendingupdates', 17 | name='data', 18 | ), 19 | migrations.AddField( 20 | model_name='pendingupdates', 21 | name='data_date_keys', 22 | field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=database.models.PendingUpdates.default_string_array, size=None), 23 | ), 24 | migrations.AddField( 25 | model_name='pendingupdates', 26 | name='data_date_values', 27 | field=django.contrib.postgres.fields.ArrayField(base_field=models.DateField(), default=database.models.PendingUpdates.default_string_array, size=None), 28 | ), 29 | migrations.AddField( 30 | model_name='pendingupdates', 31 | name='data_string_keys', 32 | field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=database.models.PendingUpdates.default_string_array, size=None), 33 | ), 34 | migrations.AddField( 35 | model_name='pendingupdates', 36 | name='data_string_values', 37 | field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=database.models.PendingUpdates.default_string_array, size=None), 38 | ), 39 | migrations.AddField( 40 | model_name='pendingupdates', 41 | name='data_time_keys', 42 | field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=database.models.PendingUpdates.default_string_array, size=None), 43 | ), 44 | migrations.AddField( 45 | model_name='pendingupdates', 46 | name='data_time_values', 47 | field=django.contrib.postgres.fields.ArrayField(base_field=models.TimeField(), default=database.models.PendingUpdates.default_string_array, size=None), 48 | ), 49 | ] 50 | -------------------------------------------------------------------------------- /server/database/migrations/0014_auto_20190426_2204.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-26 22:04 2 | 3 | import database.models 4 | import django.contrib.postgres.fields 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('database', '0013_auto_20190426_2159'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='pendingupdates', 17 | name='data_boolean_keys', 18 | field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=database.models.PendingUpdates.default_string_array, size=None), 19 | ), 20 | migrations.AddField( 21 | model_name='pendingupdates', 22 | name='data_boolean_values', 23 | field=django.contrib.postgres.fields.ArrayField(base_field=models.BooleanField(), default=database.models.PendingUpdates.default_string_array, size=None), 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /server/database/migrations/0015_auto_20190426_2213.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-26 22:13 2 | 3 | import database.models 4 | import django.contrib.postgres.fields 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('database', '0014_auto_20190426_2204'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='pendingupdates', 17 | name='data_int_keys', 18 | field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=50), default=database.models.PendingUpdates.default_string_array, size=None), 19 | ), 20 | migrations.AddField( 21 | model_name='pendingupdates', 22 | name='data_int_values', 23 | field=django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), default=database.models.PendingUpdates.default_string_array, size=None), 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /server/database/migrations/0016_auto_20190426_2226.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-26 22:26 2 | 3 | import database.models 4 | import django.contrib.postgres.fields 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('database', '0015_auto_20190426_2213'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='pendingupdates', 17 | name='data_string_values', 18 | field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=2000), default=database.models.PendingUpdates.default_string_array, size=None), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /server/database/migrations/0017_auto_20190426_2308.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-26 23:08 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0016_auto_20190426_2226'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='servicemetadata', 15 | name='updated_0', 16 | ), 17 | migrations.RemoveField( 18 | model_name='servicemetadata', 19 | name='updated_1', 20 | ), 21 | migrations.RemoveField( 22 | model_name='servicemetadata', 23 | name='updated_2', 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /server/database/migrations/0018_usermetadata_db_name_0.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-26 23:20 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0017_auto_20190426_2308'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='usermetadata', 15 | name='db_name_0', 16 | field=models.CharField(default='', max_length=50), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /server/database/migrations/0019_auto_20190427_2333.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-27 23:33 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0018_usermetadata_db_name_0'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='bookingmetadata', 15 | name='db_name_0', 16 | field=models.CharField(default='', max_length=20), 17 | ), 18 | migrations.AddField( 19 | model_name='bookingmetadata', 20 | name='db_name_1', 21 | field=models.CharField(default='', max_length=20), 22 | ), 23 | migrations.AddField( 24 | model_name='bookingmetadata', 25 | name='db_name_2', 26 | field=models.CharField(default='', max_length=20), 27 | ), 28 | ] 29 | -------------------------------------------------------------------------------- /server/database/migrations/0020_heartbeatrate.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.1.7 on 2019-04-29 16:43 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('database', '0019_auto_20190427_2333'), 10 | ] 11 | 12 | operations = [ 13 | migrations.CreateModel( 14 | name='HeartBeatRate', 15 | fields=[ 16 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 17 | ('rate', models.IntegerField()), 18 | ], 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /server/database/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__init__.py -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0001_initial.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0001_initial.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0002_remove_servicemetadata_capacity.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0002_remove_servicemetadata_capacity.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0002_usermetadata.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0002_usermetadata.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0003_databasedetails.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0003_databasedetails.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0003_servicemetadata_capacity.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0003_servicemetadata_capacity.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0004_auto_20190310_0909.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0004_auto_20190310_0909.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0004_bookingmetadata.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0004_bookingmetadata.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0005_auto_20190310_1012.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0005_auto_20190310_1012.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0005_databasedetails_status.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0005_databasedetails_status.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0006_auto_20190425_0019.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0006_auto_20190425_0019.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0006_servicemetadata.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0006_servicemetadata.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0007_auto_20190425_1006.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0007_auto_20190425_1006.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0007_servicemetadata_provider.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0007_servicemetadata_provider.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0008_auto_20190409_0800.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0008_auto_20190409_0800.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0008_servicemetadata_db_name_0.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0008_servicemetadata_db_name_0.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0009_auto_20190409_0816.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0009_auto_20190409_0816.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0009_auto_20190425_1044.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0009_auto_20190425_1044.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0010_auto_20190409_0859.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0010_auto_20190409_0859.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0010_pendingupdates.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0010_pendingupdates.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0011_pendingupdates_timestamp.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0011_pendingupdates_timestamp.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0011_remove_servicemetadata_capacity.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0011_remove_servicemetadata_capacity.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0012_pendingupdates_db_name.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0012_pendingupdates_db_name.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0012_servicemetadata_cap.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0012_servicemetadata_cap.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0013_auto_20190426_2159.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0013_auto_20190426_2159.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0013_remove_servicemetadata_cap.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0013_remove_servicemetadata_cap.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0014_auto_20190426_2204.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0014_auto_20190426_2204.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0014_servicecapacity.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0014_servicecapacity.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0015_auto_20190409_1823.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0015_auto_20190409_1823.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0015_auto_20190409_1824.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0015_auto_20190409_1824.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0015_auto_20190409_1825.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0015_auto_20190409_1825.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0015_auto_20190426_2213.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0015_auto_20190426_2213.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0015_delete_servicecapacity.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0015_delete_servicecapacity.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0016_auto_20190426_2226.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0016_auto_20190426_2226.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0016_delete_hotelbookingmetadata.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0016_delete_hotelbookingmetadata.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0017_auto_20190426_2308.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0017_auto_20190426_2308.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0018_usermetadata_db_name_0.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0018_usermetadata_db_name_0.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0019_auto_20190427_2333.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0019_auto_20190427_2333.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/0020_heartbeatrate.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/0020_heartbeatrate.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/database/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /server/database/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /server/database/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /server/hotels/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/hotels/__init__.py -------------------------------------------------------------------------------- /server/hotels/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/hotels/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /server/hotels/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/hotels/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /server/hotels/__pycache__/forms.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/hotels/__pycache__/forms.cpython-36.pyc -------------------------------------------------------------------------------- /server/hotels/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/hotels/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /server/hotels/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/hotels/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /server/hotels/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/hotels/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /server/hotels/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /server/hotels/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class HotelsConfig(AppConfig): 5 | name = 'hotels' 6 | -------------------------------------------------------------------------------- /server/hotels/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from database import utils, models 3 | from django.utils.crypto import get_random_string 4 | 5 | class HotelSearchForm(forms.Form): 6 | area = forms.CharField(max_length = 100, required = False) 7 | city = forms.CharField(max_length = 100, required = True) 8 | check_in = forms.DateField(required = True) 9 | check_out = forms.DateField(required = True) 10 | 11 | class HotelBookForm(forms.Form): 12 | in_date = forms.CharField(max_length = 50, required = True) 13 | out_date = forms.CharField(max_length = 50, required = True) 14 | rooms = forms.IntegerField(required = True) 15 | available = forms.IntegerField(required = True, widget = forms.HiddenInput()) 16 | 17 | class DateForm(forms.Form): 18 | date = forms.DateField(required = True) 19 | -------------------------------------------------------------------------------- /server/hotels/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/hotels/migrations/__init__.py -------------------------------------------------------------------------------- /server/hotels/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/hotels/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /server/hotels/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /server/hotels/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /server/hotels/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | app_name = 'hotels' 5 | 6 | urlpatterns = [ 7 | 8 | path('hotels', views.HotelSearchView.as_view(), name = 'Search'), 9 | path('hotels/list', views.HotelDisplayView.as_view(), name = 'Display'), 10 | path('hotels/view/', views.HotelDetailsView.as_view(), name = 'Details'), 11 | path('hotels/bookings/', views.HotelBookingListView.as_view(), name = 'Bookings'), 12 | 13 | ] 14 | -------------------------------------------------------------------------------- /server/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == '__main__': 6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.settings') 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError as exc: 10 | raise ImportError( 11 | "Couldn't import Django. Are you sure it's installed and " 12 | "available on your PYTHONPATH environment variable? Did you " 13 | "forget to activate a virtual environment?" 14 | ) from exc 15 | execute_from_command_line(sys.argv) 16 | -------------------------------------------------------------------------------- /server/person/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/person/__init__.py -------------------------------------------------------------------------------- /server/person/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/person/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /server/person/__pycache__/admin.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/person/__pycache__/admin.cpython-36.pyc -------------------------------------------------------------------------------- /server/person/__pycache__/forms.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/person/__pycache__/forms.cpython-36.pyc -------------------------------------------------------------------------------- /server/person/__pycache__/models.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/person/__pycache__/models.cpython-36.pyc -------------------------------------------------------------------------------- /server/person/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/person/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /server/person/__pycache__/views.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/person/__pycache__/views.cpython-36.pyc -------------------------------------------------------------------------------- /server/person/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /server/person/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class PersonConfig(AppConfig): 5 | name = 'person' 6 | -------------------------------------------------------------------------------- /server/person/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/person/migrations/__init__.py -------------------------------------------------------------------------------- /server/person/migrations/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/person/migrations/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /server/person/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /server/person/templates/person/dashboard.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load widget_tweaks %} 3 | 4 | {% block service_block %}{% if type != 'S' %}style="visibilty: hidden; display: none;"{% endif %}{% endblock %} 5 | {% block admin_block %}{% if type != 'A' %}style="visibilty: hidden; display: none;"{% endif %}{% endblock %} 6 | 7 | {% block title_block %}Dashboard{% endblock %} 8 | 9 | {% block content_block %} 10 | 11 |
12 | 13 |

PLAN YOUR TRIP

14 |
15 |
16 |
17 |
EasyTravels Hotels
18 |
Book Now
19 |
20 |
21 |
22 |
23 |
EasyTravels Buses
24 |
Book Now
25 |
26 |
27 |
28 | 29 |
30 |

Why Choose

EasyTravels

31 |
32 |
33 | 34 |
{{ users }}
Registered Users
35 |
{{ bookings }}
Successful Bookings
36 |
{{ services }}
Services
37 | 38 |
39 |
40 |
41 |
42 | 43 | {% endblock %} 44 | -------------------------------------------------------------------------------- /server/person/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /server/person/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | app_name = 'person' 5 | 6 | urlpatterns = [ 7 | 8 | path('dashboard', views.DashboardView.as_view(), name = 'Dashboard'), 9 | path('manage', views.AdminView.as_view(), name = 'Admin'), 10 | path('logout', views.LogoutView.as_view(), name = 'Logout'), 11 | path('services', views.ServiceView.as_view(), name = 'Services'), 12 | path('service/', views.EditServiceView.as_view(), name = 'EditService'), 13 | path('delete_manager_from_service//', views.DeleteManagerView.as_view(), name = 'DeleteManager'), 14 | path('delete_bus_route//', views.DeleteRouteView.as_view(), name = 'DeleteBusRoute'), 15 | 16 | ] 17 | -------------------------------------------------------------------------------- /server/server/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/server/__init__.py -------------------------------------------------------------------------------- /server/server/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/server/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /server/server/__pycache__/settings.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/server/__pycache__/settings.cpython-36.pyc -------------------------------------------------------------------------------- /server/server/__pycache__/urls.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/server/__pycache__/urls.cpython-36.pyc -------------------------------------------------------------------------------- /server/server/__pycache__/wsgi.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/server/server/__pycache__/wsgi.cpython-36.pyc -------------------------------------------------------------------------------- /server/server/urls.py: -------------------------------------------------------------------------------- 1 | """server URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path, include 18 | 19 | urlpatterns = [ 20 | path('admin/', admin.site.urls), 21 | path('', include('accounts.urls')), 22 | path('', include('person.urls')), 23 | path('', include('hotels.urls')), 24 | path('booking/', include('booking.urls')), 25 | path('', include('buses.urls')), 26 | ] 27 | -------------------------------------------------------------------------------- /server/server/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for server project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | from database import models, utils 12 | import threading, time 13 | 14 | def heartbeat(): 15 | print('----------------------------------------------- HEARTBEAT ------------------------------------------------') 16 | S = utils.check_status() 17 | print(S) 18 | print('----------------------------------------------------------------------------------------------------------') 19 | for key in S: 20 | db = models.DatabaseDetails.objects.get(name = key) 21 | if(S[key] == 1): 22 | pending_updates = models.PendingUpdates.objects.filter(db_name = db.name).order_by('timestamp') 23 | while pending_updates.count() > 0: 24 | for update in pending_updates: 25 | try: 26 | r = utils.perform_update(update) 27 | if r == 200 or r == 201: 28 | update.delete() 29 | except Exception as e: 30 | print(e) 31 | continue 32 | 33 | pending_updates = models.PendingUpdates.objects.filter(db_name = db.name).order_by('timestamp') 34 | 35 | db.status = S[key] 36 | db.save() 37 | wait_time = int(models.HeartBeatRate.objects.all()[0].rate) 38 | time.sleep(wait_time) 39 | heartbeat() 40 | 41 | heartbeat_thread = threading.Thread(target = heartbeat) 42 | heartbeat_thread.start() 43 | 44 | from django.core.wsgi import get_wsgi_application 45 | 46 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.settings') 47 | 48 | application = get_wsgi_application() 49 | -------------------------------------------------------------------------------- /snapshots/Admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/snapshots/Admin.png -------------------------------------------------------------------------------- /snapshots/Dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/snapshots/Dashboard.png -------------------------------------------------------------------------------- /snapshots/Details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/snapshots/Details.png -------------------------------------------------------------------------------- /snapshots/Manage_Service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/snapshots/Manage_Service.png -------------------------------------------------------------------------------- /snapshots/New_Service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/snapshots/New_Service.png -------------------------------------------------------------------------------- /snapshots/Search_Hotels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/snapshots/Search_Hotels.png -------------------------------------------------------------------------------- /snapshots/Search_Results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/snapshots/Search_Results.png -------------------------------------------------------------------------------- /snapshots/Upcoming.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ks-amit/Distributed-Database/8f573976b80d6fa1f7806882a59ac933fbd68b3c/snapshots/Upcoming.png --------------------------------------------------------------------------------