diff --git a/db.sqlite3 b/db.sqlite3 index 9b592a5..ceccc8c 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/main/__init__.py b/main/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/main/__pycache__/__init__.cpython-312.pyc b/main/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index f3fc19c..0000000 Binary files a/main/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/main/__pycache__/models.cpython-312.pyc b/main/__pycache__/models.cpython-312.pyc index 55caee2..93e9ab6 100644 Binary files a/main/__pycache__/models.cpython-312.pyc and b/main/__pycache__/models.cpython-312.pyc differ diff --git a/main/__pycache__/views.cpython-312.pyc b/main/__pycache__/views.cpython-312.pyc index e6b4682..3921c4e 100644 Binary files a/main/__pycache__/views.cpython-312.pyc and b/main/__pycache__/views.cpython-312.pyc differ diff --git a/main/migrations/__init__.py b/main/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/main/models.py b/main/models.py index 0114c2d..b2b17f1 100644 --- a/main/models.py +++ b/main/models.py @@ -25,11 +25,15 @@ def __str__(self) -> str: class Product_images(models.Model): product_id = models.ForeignKey(Product,on_delete=models.CASCADE) product_images = models.ImageField(upload_to='product_images/') + def __str__(self) -> str: + return self.product_id.product_id class bidding(models.Model): product_id = models.ForeignKey(Product,on_delete=models.CASCADE) user_name = models.ForeignKey(users,on_delete=models.CASCADE) for_price = models.IntegerField() + def __str__(self) -> str: + return f'{self.user_name.user_name} bidded for {self.product_id.product_id}' class user_activity(models.Model): user_name = models.ForeignKey(users,on_delete=models.CASCADE) diff --git a/main/views.py b/main/views.py index 166913f..c80e565 100644 --- a/main/views.py +++ b/main/views.py @@ -3,6 +3,7 @@ from django.http import HttpResponse from . import models from django.conf import settings +from django.http import JsonResponse # Create your views here. def index(request): logged_in = True if settings.LOGGED_IN else False @@ -16,7 +17,6 @@ def index(request): 'login' : logged_in, 'data' : data, } - print(data) if logged_in: user_name = settings.USER_NAME user = models.users.objects.get(user_name=user_name) @@ -102,7 +102,7 @@ def auctions(request): def auction(request,auction_name): data = models.Product.objects.get(product_id=auction_name) image = models.Product_images.objects.filter(product_id=auction_name).first() - bidding = models.bidding.objects.filter(product_id=auction_name).all() + bidding = models.bidding.objects.filter(product_id=auction_name).all()[::-1] template = loader.get_template('auction.html') context = { diff --git a/media/product_images/obito_QKZJBCE.jpeg b/media/product_images/obito_QKZJBCE.jpeg new file mode 100644 index 0000000..c44a1cb Binary files /dev/null and b/media/product_images/obito_QKZJBCE.jpeg differ diff --git a/static/js/description.js b/static/js/description.js index e69de29..a4ac5a1 100644 --- a/static/js/description.js +++ b/static/js/description.js @@ -0,0 +1,3 @@ +function myFunction() { + alert("Hello iam desciption"); + } \ No newline at end of file diff --git a/static/styles.css b/static/styles.css index 94139a6..620b2b1 100644 --- a/static/styles.css +++ b/static/styles.css @@ -377,15 +377,16 @@ button:hover { text-align: center; border-radius: 10px; } -.new_bid input[type="text"] { - height: 15px; +.new_bid input[type="number"] { + height: 28px; width: 120px; - margin-top: 15px; - margin-left: 10px; - margin-right: 10px; + margin-top: 18px; + margin-left: 2px; + margin-right: 2px; border: 1px solid #000; font-size: 20px; color: #000; + border-radius: 5px; } .bid_button { diff --git a/templates/auction.html b/templates/auction.html index c171052..39f0d46 100644 --- a/templates/auction.html +++ b/templates/auction.html @@ -18,7 +18,7 @@