-
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.
Merge pull request #3 from CrzyHAX91/local_changes
Local changes
- Loading branch information
Showing
45 changed files
with
86 additions
and
23 deletions.
There are no files selected for viewing
Binary file added
BIN
+2.46 MB
.cache/pip/http/1/5/8/5/c/1585c3c2a7189e4f5a663ec8717e5584cec5da4cda5085ec94b69f60
Binary file not shown.
Binary file added
BIN
+6.76 KB
.cache/pip/http/1/f/3/6/e/1f36e4fb24023fde97b032397872135c7514eeb07753ac9e6c41bfd9
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
.cache/pip/http/2/9/d/9/c/29d9c8f7783ec78ee2d54fb2a36c3a86da2bb890d649da0de3837279
Binary file not shown.
Binary file added
BIN
+15.1 KB
.cache/pip/http/2/a/4/1/c/2a41cb8e405637e51ada370419ba2d90cff5ec7779741a4b3b53a257
Binary file not shown.
Binary file added
BIN
+24.7 KB
.cache/pip/http/2/e/c/b/a/2ecba72f4cc3117816f8364f21e7a236c810e36d31486128af54d549
Binary file not shown.
Binary file added
BIN
+12.4 KB
.cache/pip/http/5/a/c/c/e/5acced274727d7dad7cee6ffa5300420bbeaf89f818386c9654d39e2
Binary file not shown.
Binary file added
BIN
+23.6 KB
.cache/pip/http/6/c/e/f/0/6cef03b7a89bed3b093baaef7c1a73bf06919e5827a8855e0811de6e
Binary file not shown.
Binary file added
BIN
+2.84 KB
.cache/pip/http/7/5/2/0/1/75201d58a342f216e277eddac2f2971b0d46b59ecfcb3489e02a40e3
Binary file not shown.
Binary file added
BIN
+4.43 KB
.cache/pip/http/7/d/c/9/2/7dc9235bf71af333ff8590f1a5265626d4a7583ec9c0a05937017a16
Binary file not shown.
Binary file added
BIN
+6.27 KB
.cache/pip/http/8/8/b/b/d/88bbd17929132fc9cebab4bfa162c3d0fb168cb469d6f19de6053d83
Binary file not shown.
Binary file added
BIN
+50.2 KB
.cache/pip/http/f/7/0/6/5/f706524524a7a241d662ef7c9f9bdaae3d8f6d7913aaa3f240e45db8
Binary file not shown.
Binary file added
BIN
+5.77 KB
...5f/ba/e972a56dcbf5de9f2b7d2b2a710113970bd173c4dcd3d2c902/ratelimit-2.2.1-py3-none-any.whl
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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,59 @@ | ||
from django.contrib.auth.models import AbstractUser | ||
from django.db import models | ||
|
||
class CustomUser(AbstractUser): | ||
phone_number = models.CharField(max_length=15, blank=True, null=True) | ||
address = models.TextField(blank=True, null=True) | ||
date_of_birth = models.DateField(blank=True, null=True) | ||
|
||
def __str__(self): | ||
return self.email | ||
|
||
class Category(models.Model): | ||
name = models.CharField(max_length=100) | ||
slug = models.SlugField(unique=True) | ||
|
||
def __str__(self): | ||
return self.name | ||
|
||
class Product(models.Model): | ||
name = models.CharField(max_length=200) | ||
description = models.TextField() | ||
price = models.DecimalField(max_digits=10, decimal_places=2) | ||
category = models.ForeignKey(Category, on_delete=models.CASCADE) | ||
stock = models.PositiveIntegerField() | ||
|
||
def __str__(self): | ||
return self.name | ||
|
||
class Order(models.Model): | ||
user = models.ForeignKey(CustomUser, on_delete=models.CASCADE) | ||
created_at = models.DateTimeField(auto_now_add=True) | ||
updated_at = models.DateTimeField(auto_now=True) | ||
total_price = models.DecimalField(max_digits=10, decimal_places=2) | ||
status = models.CharField(max_length=20, default='pending') | ||
|
||
def __str__(self): | ||
return f"Order {self.id} by {self.user.username}" | ||
|
||
class CartItem(models.Model): | ||
user = models.ForeignKey(CustomUser, on_delete=models.CASCADE) | ||
product = models.ForeignKey(Product, on_delete=models.CASCADE) | ||
quantity = models.PositiveIntegerField(default=1) | ||
|
||
def __str__(self): | ||
return f"{self.quantity} x {self.product.name}" | ||
|
||
|
||
from django.utils.crypto import get_random_string | ||
|
||
class EmailVerificationToken(models.Model): | ||
user = models.OneToOneField(CustomUser, on_delete=models.CASCADE) | ||
token = models.CharField(max_length=64, unique=True) | ||
created_at = models.DateTimeField(auto_now_add=True) | ||
|
||
@classmethod | ||
def create_token(cls, user): | ||
token = get_random_string(64) | ||
return cls.objects.create(user=user, token=token) | ||
|
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 |
---|---|---|
|
@@ -23,7 +23,6 @@ charset-normalizer | |
click | ||
comm | ||
cryptography | ||
dbus-python | ||
debugpy | ||
decorator | ||
defusedxml | ||
|
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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