feat(whole project): huge changes, huge updates

This commit is contained in:
sankalp committed 2025-04-24 20:17:52 +05:45
1 parent 666b5bb827
commit 2bd8bb2dfc
196 files changed
+9146 -4316

No files matched your search

+129
View File
@@ -0,0 +1,129 @@
# Generated by Django 5.2 on 2025-04-20 06:29
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=100, unique=True)),
('image', models.ImageField(upload_to='categories/')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
options={
'verbose_name': 'Category',
'verbose_name_plural': 'Categories',
'ordering': ['name'],
},
),
migrations.CreateModel(
name='User',
fields=[
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('id', models.BigAutoField(primary_key=True, serialize=False)),
('username', models.CharField(max_length=150, unique=True)),
('first_name', models.CharField(max_length=30)),
('last_name', models.CharField(max_length=30)),
('email', models.EmailField(max_length=254, unique=True)),
('is_active', models.BooleanField(default=True)),
('is_staff', models.BooleanField(default=False)),
('phone', models.CharField(blank=True, max_length=15, null=True)),
('address', models.TextField(blank=True, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
],
options={
'verbose_name': 'User',
'verbose_name_plural': 'Users',
'ordering': ['username'],
},
),
migrations.CreateModel(
name='Order',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('total_price', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
('status', models.CharField(choices=[('Pending', 'Pending'), ('Shipped', 'Shipped'), ('Delivered', 'Delivered'), ('Cancelled', 'Cancelled')], default='Pending', max_length=20)),
('shipping_address', models.CharField(blank=True, max_length=255)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orders', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Order',
'verbose_name_plural': 'Orders',
'ordering': ['-created_at'],
},
),
migrations.CreateModel(
name='Product',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=100)),
('description', models.TextField()),
('price', models.DecimalField(decimal_places=2, max_digits=10)),
('image', models.ImageField(upload_to='products/')),
('size', models.CharField(blank=True, max_length=10, null=True)),
('color', models.CharField(blank=True, max_length=20, null=True)),
('stock', models.IntegerField(default=0)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='products', to='app.category')),
],
options={
'verbose_name': 'Product',
'verbose_name_plural': 'Products',
'ordering': ['name'],
},
),
migrations.CreateModel(
name='OrderItem',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('quantity', models.IntegerField()),
('price', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_items', to='app.order')),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_items', to='app.product')),
],
options={
'verbose_name': 'Order Item',
'verbose_name_plural': 'Order Items',
'ordering': ['order'],
},
),
migrations.CreateModel(
name='Rating',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
('rating', models.IntegerField()),
('comment', models.TextField(blank=True, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ratings', to='app.product')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ratings', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Rating',
'verbose_name_plural': 'Ratings',
'ordering': ['-created_at'],
'unique_together': {('product', 'user')},
},
),
]
@@ -0,0 +1,46 @@
# Generated by Django 5.2 on 2025-04-23 06:22
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Cart',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='cart', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Cart',
'verbose_name_plural': 'Carts',
'ordering': ['-updated_at'],
},
),
migrations.CreateModel(
name='CartItem',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('quantity', models.PositiveIntegerField(default=1)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('cart', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='app.cart')),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cart_items', to='app.product')),
],
options={
'verbose_name': 'Cart Item',
'verbose_name_plural': 'Cart Items',
'ordering': ['-updated_at'],
'unique_together': {('cart', 'product')},
},
),
]
@@ -0,0 +1,58 @@
# Generated by Django 5.2 on 2025-04-23 12:23
import django.core.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0002_cart_cartitem'),
]
operations = [
migrations.AddField(
model_name='category',
name='description',
field=models.TextField(blank=True),
),
migrations.AddField(
model_name='product',
name='average_rating',
field=models.DecimalField(decimal_places=2, default=0, max_digits=3),
),
migrations.AddField(
model_name='user',
name='phone_number',
field=models.CharField(blank=True, max_length=15, null=True),
),
migrations.AlterField(
model_name='category',
name='image',
field=models.ImageField(blank=True, null=True, upload_to='categories/'),
),
migrations.AlterField(
model_name='product',
name='image',
field=models.ImageField(blank=True, null=True, upload_to='products/'),
),
migrations.AlterField(
model_name='rating',
name='rating',
field=models.IntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)]),
),
migrations.CreateModel(
name='Favorite',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='favorites', to='app.product')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='favorites', to=settings.AUTH_USER_MODEL)),
],
options={
'unique_together': {('user', 'product')},
},
),
]
@@ -0,0 +1,22 @@
# Generated by Django 5.2 on 2025-04-23 17:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("app", "0003_category_description_product_average_rating_and_more"),
]
operations = [
migrations.AddField(
model_name="user",
name="gender",
field=models.CharField(
choices=[("Male", "Male"), ("Female", "Female"), ("Other", "Other")],
default="Male",
max_length=10,
),
),
]
@@ -0,0 +1,18 @@
# Generated by Django 5.2 on 2025-04-23 18:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0004_user_gender'),
]
operations = [
migrations.AddField(
model_name='user',
name='profile_picture',
field=models.ImageField(blank=True, null=True, upload_to='profile_pictures/'),
),
]
@@ -0,0 +1,26 @@
# Generated by Django 5.2 on 2025-04-23 22:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0005_user_profile_picture'),
]
operations = [
migrations.CreateModel(
name='PrivacyPolicy',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=200)),
('content', models.TextField()),
('last_updated', models.DateTimeField(auto_now=True)),
('is_active', models.BooleanField(default=True)),
],
options={
'verbose_name_plural': 'Privacy Policies',
},
),
]
+29
View File
@@ -0,0 +1,29 @@
# Generated by Django 5.2 on 2025-04-23 22:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0006_privacypolicy'),
]
operations = [
migrations.CreateModel(
name='FAQ',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('question', models.CharField(max_length=255)),
('answer', models.TextField()),
('category', models.CharField(choices=[('All', 'All'), ('Services', 'Services'), ('General', 'General'), ('Account', 'Account')], default='General', max_length=20)),
('is_active', models.BooleanField(default=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
options={
'verbose_name_plural': 'FAQs',
'ordering': ['-created_at'],
},
),
]
+28
View File
@@ -0,0 +1,28 @@
# Generated by Django 5.2 on 2025-04-23 22:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0007_faq'),
]
operations = [
migrations.CreateModel(
name='Contact',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('contact_type', models.CharField(choices=[('customer_service', 'Customer Service'), ('whatsapp', 'WhatsApp'), ('website', 'Website'), ('facebook', 'Facebook'), ('instagram', 'Instagram'), ('twitter', 'Twitter')], max_length=20)),
('title', models.CharField(max_length=100)),
('value', models.CharField(max_length=200)),
('is_active', models.BooleanField(default=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
options={
'ordering': ['contact_type'],
},
),
]
@@ -0,0 +1,18 @@
# Generated by Django 5.2 on 2025-04-23 22:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0008_contact'),
]
operations = [
migrations.AlterField(
model_name='contact',
name='value',
field=models.CharField(max_length=255),
),
]
@@ -0,0 +1,28 @@
# Generated by Django 5.2 on 2025-04-23 23:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0009_alter_contact_value'),
]
operations = [
migrations.CreateModel(
name='InviteMessage',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('message', models.TextField()),
('is_active', models.BooleanField(default=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
options={
'verbose_name': 'Invite Message',
'verbose_name_plural': 'Invite Messages',
'ordering': ['-created_at'],
},
),
]
@@ -0,0 +1,18 @@
# Generated by Django 5.2 on 2025-04-23 23:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0010_invitemessage'),
]
operations = [
migrations.AddField(
model_name='invitemessage',
name='link',
field=models.URLField(default='https://play.google.com/store/apps/details?id=com.example.app', help_text='App store or download link', max_length=500),
),
]
@@ -0,0 +1,18 @@
# Generated by Django 5.2 on 2025-04-23 23:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0011_invitemessage_link'),
]
operations = [
migrations.AlterField(
model_name='invitemessage',
name='link',
field=models.URLField(help_text='App store or download link', max_length=500),
),
]
@@ -0,0 +1,16 @@
# Generated by Django 5.2 on 2025-04-23 23:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0012_alter_invitemessage_link'),
]
operations = [
migrations.DeleteModel(
name='InviteMessage',
),
]
+30
View File
@@ -0,0 +1,30 @@
# Generated by Django 5.2 on 2025-04-24 00:30
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0013_delete_invitemessage'),
]
operations = [
migrations.CreateModel(
name='Slider',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=200)),
('description', models.TextField()),
('image', models.ImageField(upload_to='sliders/')),
('is_active', models.BooleanField(default=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='app.category')),
],
options={
'ordering': ['-created_at'],
},
),
]
@@ -0,0 +1,19 @@
# Generated by Django 5.2 on 2025-04-24 00:32
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0014_slider'),
]
operations = [
migrations.AlterField(
model_name='slider',
name='category',
field=models.ForeignKey(blank=True, help_text="Category to show when clicking the 'Show Now' button", null=True, on_delete=django.db.models.deletion.SET_NULL, to='app.category'),
),
]
@@ -0,0 +1,18 @@
# Generated by Django 5.2 on 2025-04-24 00:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0015_alter_slider_category'),
]
operations = [
migrations.AlterField(
model_name='slider',
name='image',
field=models.ImageField(blank=True, null=True, upload_to='sliders/'),
),
]
+34
View File
@@ -0,0 +1,34 @@
# Generated by Django 5.2 on 2025-04-24 10:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0016_alter_slider_image'),
]
operations = [
migrations.CreateModel(
name='Coupon',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('code', models.CharField(max_length=50, unique=True)),
('discount_type', models.CharField(choices=[('percentage', 'Percentage'), ('fixed', 'Fixed Amount')], default='percentage', max_length=10)),
('discount_value', models.DecimalField(decimal_places=2, max_digits=10)),
('min_purchase', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
('max_discount', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
('is_active', models.BooleanField(default=True)),
('start_date', models.DateTimeField()),
('end_date', models.DateTimeField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
options={
'verbose_name': 'Coupon',
'verbose_name_plural': 'Coupons',
'ordering': ['-created_at'],
},
),
]
@@ -0,0 +1,18 @@
# Generated by Django 5.2 on 2025-04-24 10:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0017_coupon'),
]
operations = [
migrations.AlterField(
model_name='user',
name='gender',
field=models.CharField(blank=True, choices=[('Male', 'Male'), ('Female', 'Female'), ('Other', 'Other')], default='Male', max_length=10),
),
]
@@ -0,0 +1,31 @@
# Generated by Django 5.2 on 2025-04-24 11:46
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0018_alter_user_gender'),
]
operations = [
migrations.CreateModel(
name='Notification',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('type', models.CharField(choices=[('order_placed', 'Order Placed'), ('order_shipped', 'Order Shipped'), ('order_delivered', 'Order Delivered'), ('order_cancelled', 'Order Cancelled'), ('coupon', 'Coupon')], max_length=20)),
('message', models.TextField()),
('read', models.BooleanField(default=False)),
('created_at', models.DateTimeField(auto_now_add=True)),
('coupon', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='app.coupon')),
('order', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='app.order')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['-created_at'],
},
),
]
View File
Whitespace-only changes.