From 1413924e5cdee379ac9bd1f5b97d47a7ed53df7e Mon Sep 17 00:00:00 2001 From: Akuev Date: Wed, 28 Feb 2024 12:44:57 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B2=D0=BD=D0=B5=D1=88=D0=BD=D0=B8=D0=B9=20=D0=BA?= =?UTF-8?q?=D0=BB=D1=8E=D1=87=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=D0=B5=D0=BB=D1=8F=20=D1=83=20=D0=BC=D0=BE=D0=B4?= =?UTF-8?q?=D0=B5=D0=BB=D0=B8=20=D0=BA=D1=83=D1=80=D1=8C=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- delivers/models/couriers.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/delivers/models/couriers.py b/delivers/models/couriers.py index 95c30b24..26b675fd 100644 --- a/delivers/models/couriers.py +++ b/delivers/models/couriers.py @@ -13,6 +13,7 @@ class Courier(BaseModel): Модель курьера. Атрибуты: + * `user` (ForeignKey): пользователь. * `name` (CharField): название курьера. * `phone_number` (PhoneNumberField): номер телефона курьера. * `email` (EmailField): почта курьера. @@ -20,6 +21,15 @@ class Courier(BaseModel): * `vehicle` (ManyToManyField): транспортное средство. * `is_available` (BooleanField): доступен ли курьер для выполнения доставок. """ + # region ------------------------- АТРИБУТЫ КУРЬЕРА ----------------------------- + user = models.ForeignKey( + to='users.User', + on_delete=models.RESTRICT, + related_name='couriers', + verbose_name='Пользователь', + null=True, + blank=True, + ) name = models.CharField( verbose_name='Название организации', max_length=100, @@ -62,6 +72,7 @@ class Courier(BaseModel): decimal_places=2, default=0.00 ) + # endregion --------------------------------------------------------------------- def __str__(self) -> CharField: return self.name