commition field added to shop model
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 5.1.2 on 2025-11-17 05:17
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('account', '0032_specialdiscountcode'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='shopmodel',
|
||||
name='commission_percent',
|
||||
field=models.DecimalField(decimal_places=2, default=0, max_digits=5, verbose_name='درصد کمیسیون'),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
@@ -142,6 +142,7 @@ class ShopModel(models.Model):
|
||||
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='shop', verbose_name='کاربر')
|
||||
shop_name = models.CharField(max_length=100, verbose_name='نام فروشگاه')
|
||||
shop_description = models.TextField(verbose_name='توضیحات فروشگاه')
|
||||
commission_percent = models.DecimalField(max_digits=5, decimal_places=2, verbose_name='درصد کمیسیون')
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.user.phone} - {self.shop_name}"
|
||||
|
||||
Reference in New Issue
Block a user