homepage carousel is getting slides from web_services table

This commit is contained in:
2024-10-08 20:50:19 +09:00
parent 0e82b86e51
commit ee254ef17f
7 changed files with 50 additions and 32 deletions

View File

@@ -1,5 +1,7 @@
# web/models.py
from django.db import models
from django.contrib.auth.models import AbstractUser
class Category(models.Model):
name = models.CharField(max_length=100)
@@ -79,4 +81,18 @@ class Review(models.Model):
image = models.ImageField(upload_to='static/img/review/', blank=True, null=True)
def __str__(self):
return f"Review by {self.client.first_name} {self.client.last_name} for {self.service.name}"
return f"Review by {self.client.first_name} {self.client.last_name} for {self.service.name}"
COMMUNICATION_METHODS = [
('email', 'Email'),
('telegram', 'Telegram'),
('sms', 'SMS'),
]
class User(AbstractUser):
telegram_id = models.CharField(max_length=50, blank=True, null=True, unique=True)
preferred_communication = models.CharField(
max_length=20,
choices=COMMUNICATION_METHODS,
default='email',
)