From 97eae01c11e6b224d727add24cc592bf965f3521 Mon Sep 17 00:00:00 2001 From: "Gleb O. Ivaniczkij" Date: Sun, 22 Sep 2024 18:10:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=BE=D0=B4=D0=B5=D0=BB=D1=8F=D0=BC=20?= =?UTF-8?q?=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=B8=D0=B7=D0=BE=D0=B1?= =?UTF-8?q?=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=B4=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=B8=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80?= =?UTF-8?q?=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B2=20=D0=BF=D0=B0?= =?UTF-8?q?=D0=BD=D0=B5=D0=BB=D0=B8=20=D0=B0=D0=B4=D0=BC=D0=B8=D0=BD=D0=B8?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=B0=D1=82=D0=BE=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index a006ca6..76b3180 100644 --- a/app/models.py +++ b/app/models.py @@ -22,22 +22,38 @@ class RoomImage(Model): verbose_name = 'изображение комнаты' verbose_name_plural = 'изображения комнат' + name = CharField( + verbose_name='Название', + max_length=32, + unique=True, + ) image = ImageField( verbose_name='Изображение', upload_to=upload_to('media/rooms/images'), ) + def __str__(self): + return self.name + class RoomPanorama(Model): class Meta: verbose_name = 'панорама комнаты' verbose_name_plural = 'панорамы комнат' + name = CharField( + verbose_name='Название', + max_length=32, + unique=True, + ) image = ImageField( verbose_name='Изображение', upload_to=upload_to('media/rooms/panoramas'), ) + def __str__(self): + return self.name + class Room(Model): class Meta: @@ -86,6 +102,6 @@ class Room(Model): default=True, ) is_available = BooleanField( - verbose_name='Доступно для аренды', + verbose_name='Доступна для аренды', default=True, )