You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.5 KiB
44 lines
1.5 KiB
from django.db import models |
|
|
|
import asyncio |
|
|
|
|
|
class Orders(models.Model): |
|
SEND_MESSAGE = ( |
|
(True, 'Написать'), |
|
(False, 'Не отправлять'), |
|
(None, 'Неизвестно'), |
|
) |
|
|
|
IS_APPROVED = ( |
|
(True, 'Заказ подтвержден'), |
|
(False, 'Заказ не подтвержден'), |
|
(None, 'Неизвестно'), |
|
) |
|
|
|
param_id = models.CharField(max_length=100, verbose_name='id пользователя в tg', null=True) |
|
name = models.CharField(max_length=100, verbose_name='наименование', null=True) |
|
description = models.TextField(verbose_name='описание', null=True) |
|
order_photo = models.ImageField(upload_to='photo/') |
|
cheque = models.ImageField(upload_to='photo/') |
|
adress = models.CharField(max_length=100, verbose_name='адрес доставки', blank=True, null=True) |
|
time_create = models.DateTimeField(auto_now_add=True, null=True) |
|
# message = models.CharField(max_length=100, verbose_name='сообщение для пользователя', blank=True, null=True) |
|
# send_message = models.BooleanField(default=False, verbose_name='отправить сообщение', null=True, choices=SEND_MESSAGE) |
|
is_approved = models.BooleanField(default=False, verbose_name='подтверждение заказа', null=True, choices=IS_APPROVED) |
|
|
|
|
|
|
|
class Meta: |
|
app_label = 'adminpanel' |
|
verbose_name_plural = 'Заказы' |
|
|
|
def __str__(self): |
|
return self.name |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|