Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
17AnuragMishra authored Feb 17, 2024
1 parent d17f95d commit 89cd087
Show file tree
Hide file tree
Showing 72 changed files with 18,764 additions and 0 deletions.
Empty file added calc/__init__.py
Empty file.
Binary file added calc/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file added calc/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file added calc/__pycache__/views.cpython-312.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions calc/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions calc/apps.py
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 added calc/migrations/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions calc/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions calc/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
6 changes: 6 additions & 0 deletions calc/urls.py
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')
]
6 changes: 6 additions & 0 deletions calc/views.py
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 added inntrack/__init__.py
Empty file.
Binary file added inntrack/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file added inntrack/__pycache__/admin.cpython-312.pyc
Binary file not shown.
Binary file added inntrack/__pycache__/apps.cpython-312.pyc
Binary file not shown.
Binary file added inntrack/__pycache__/models.cpython-312.pyc
Binary file not shown.
Binary file added inntrack/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file added inntrack/__pycache__/views.cpython-312.pyc
Binary file not shown.
5 changes: 5 additions & 0 deletions inntrack/admin.py
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)
6 changes: 6 additions & 0 deletions inntrack/apps.py
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'
27 changes: 27 additions & 0 deletions inntrack/migrations/0001_initial.py
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)),
],
),
]
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 added inntrack/migrations/__init__.py
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16 changes: 16 additions & 0 deletions inntrack/models.py
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
3 changes: 3 additions & 0 deletions inntrack/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
17 changes: 17 additions & 0 deletions inntrack/urls.py
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
#]
99 changes: 99 additions & 0 deletions inntrack/views.py
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')
'''
Loading

0 comments on commit 89cd087

Please sign in to comment.