-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d17f95d
commit 89cd087
Showing
72 changed files
with
18,764 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class CalcConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'calc' |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.db import models | ||
|
||
# Create your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.urls import path | ||
|
||
from . import views | ||
urlpatterns = [ | ||
path('', views.home, name='home') | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.shortcuts import render | ||
from django.http import HttpResponse | ||
|
||
# Create your views here. | ||
def home(request): | ||
return HttpResponse("Hellp World") |
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.contrib import admin | ||
from .models import Shipment | ||
# Register your models here. | ||
|
||
admin.site.register(Shipment) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class InntrackConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'inntrack' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 5.0.1 on 2024-01-13 08:30 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Shipment', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('member_id', models.CharField(max_length=100)), | ||
('order_number', models.CharField(max_length=100)), | ||
('tracking_id', models.CharField(max_length=10)), | ||
('priority', models.IntegerField()), | ||
('current_location', models.CharField()), | ||
('destination', models.CharField(max_length=100)), | ||
('delivery_date', models.IntegerField(max_length=40)), | ||
], | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
inntrack/migrations/0002_alter_shipment_delivery_date_alter_shipment_priority.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 5.0.1 on 2024-01-13 08:50 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('inntrack', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='shipment', | ||
name='delivery_date', | ||
field=models.IntegerField(), | ||
), | ||
migrations.AlterField( | ||
model_name='shipment', | ||
name='priority', | ||
field=models.IntegerField(), | ||
), | ||
] |
Empty file.
Binary file not shown.
Binary file added
BIN
+872 Bytes
...ons/__pycache__/0002_alter_shipment_delivery_date_alter_shipment_priority.cpython-312.pyc
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django.db import models | ||
|
||
# Create your models here. | ||
# models.py | ||
|
||
class Shipment(models.Model): | ||
member_id = models.CharField(max_length=100) | ||
order_number = models.CharField(max_length=100) | ||
tracking_id = models.CharField(max_length=10) | ||
priority = models.IntegerField() | ||
current_location = models.CharField() | ||
destination = models.CharField(max_length=100) | ||
delivery_date = models.IntegerField() | ||
|
||
def __str__(self): | ||
return self.order_number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from django.urls import path | ||
|
||
from . import views | ||
|
||
urlpatterns = [path("", views.index, name="index"), | ||
path("", views.login, name="login"), | ||
path('service.html', views.service, name='service'), | ||
path('about.html', views.about, name='about'), | ||
path('contact.html', views.contact, name='contact'), | ||
path('shipment_details.html', views.shipment, name='shipment')] | ||
|
||
#from .views import get_shipment_details | ||
|
||
#urlpatterns = [ | ||
# path('get_shipment_details/', get_shipment_details, name='get_shipment_details'), | ||
# # Add other URL patterns as needed | ||
#] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
from django.shortcuts import render#, get_object_or_404 | ||
|
||
# Create your views here. | ||
def index(request): | ||
return render(request, 'index.html') | ||
|
||
def login(request): | ||
return render(request, 'login.html') | ||
|
||
def contact(request): | ||
return render(request, 'contact.html') | ||
|
||
def about(request): | ||
return render(request, 'about.html') | ||
|
||
def service(request): | ||
return render(request, 'service.html') | ||
|
||
def shipment(request): | ||
return render(request, 'shipment_details.html') | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
#from .models import Shipment | ||
# views.py | ||
'''def get_shipment_details(request, order_number): | ||
try: | ||
shipment = Shipment.objects.get(order_number=order_number) | ||
# Access other shipment details using shipment.<field_name> | ||
return render(request, 'index.html', {'shipment': shipment}) | ||
except Shipment.DoesNotExist: | ||
return render(request, 'shipment_not_found.html', {'order_number': order_number}) | ||
# views.py or any other Django file where you want to insert data | ||
from .models import Shipment | ||
# Create instances of the Shipment model | ||
shipment1 = Shipment(member_id='Flipkart', order_number='123456' , tracking_id='1864575IT', priority='4', current_location='lucknow', destination='cantt lucknow', delivery_date='2024-02-10') | ||
shipment2 = Shipment(member_id='Ebay', order_number='4489911', tracking_id='1648526IT', priority='4', current_location='lucknow', destination='cantt lucknow', delivery_date='2024-02-10') | ||
shipment3 = Shipment(member_id='Amazon', order_number='8419859', tracking_id='1622366IT', priority='4', current_location='lucknow', destination='cantt lucknow', delivery_date='2024-02-10') | ||
# Save the instances to the database | ||
shipment1.save() | ||
shipment2.save() | ||
shipment3.save() | ||
# views.py | ||
from .models import Shipment | ||
def get_shipment_details(request): | ||
if request.method == 'GET': | ||
order_number = request.GET.get('order_number') | ||
shipment = get_object_or_404(Shipment, order_number=order_number) | ||
return render(request, 'shipment_details.html', {'shipment': shipment}) | ||
return render(request, 'shipment_form.html') | ||
''' |
Oops, something went wrong.