From 92fb7f707433c0fae633940466f68304995a9ceb Mon Sep 17 00:00:00 2001 From: Mosunov Anton Date: Mon, 19 Sep 2022 11:43:50 +0600 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=BE=D0=B4=D0=B5=D0=BB=D1=8C,=20=D0=BC?= =?UTF-8?q?=D0=B8=D0=B3=D1=80=D0=B0=D1=86=D0=B8=D0=B8,=20=D0=B0=D0=B4?= =?UTF-8?q?=D0=BC=D0=B8=D0=BD=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Создали модель Task Произвели миграции Настроили подключение к админке: superuser (admin, admin) --- identifier.sqlite | 0 to_do_list/core/settings.py | 1 + to_do_list/to_do/migrations/0001_initial.py | 23 +++++++++++++++++++++ to_do_list/to_do/models.py | 9 +++++++- to_do_list/to_do/views/__init__.py | 0 5 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 identifier.sqlite create mode 100644 to_do_list/to_do/migrations/0001_initial.py create mode 100644 to_do_list/to_do/views/__init__.py diff --git a/identifier.sqlite b/identifier.sqlite new file mode 100644 index 0000000..e69de29 diff --git a/to_do_list/core/settings.py b/to_do_list/core/settings.py index 603b952..3c65741 100644 --- a/to_do_list/core/settings.py +++ b/to_do_list/core/settings.py @@ -37,6 +37,7 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'to_do' ] MIDDLEWARE = [ diff --git a/to_do_list/to_do/migrations/0001_initial.py b/to_do_list/to_do/migrations/0001_initial.py new file mode 100644 index 0000000..c9486c4 --- /dev/null +++ b/to_do_list/to_do/migrations/0001_initial.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2 on 2022-09-19 05:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Task', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('task_text', models.TextField(max_length=3000, verbose_name='Текст задачи')), + ('state', models.CharField(default='new', max_length=300, verbose_name='Состояние')), + ('deadline', models.DateTimeField(verbose_name='Дедлайн')), + ], + ), + ] diff --git a/to_do_list/to_do/models.py b/to_do_list/to_do/models.py index 71a8362..19e29c4 100644 --- a/to_do_list/to_do/models.py +++ b/to_do_list/to_do/models.py @@ -1,3 +1,10 @@ from django.db import models -# Create your models here. + +class Task(models.Model): + task_text = models.TextField(verbose_name='Текст задачи', max_length=3000, null=False, blank=False) + state = models.CharField(verbose_name='Состояние', max_length=300, null=False, blank=False, default='new') + deadline = models.DateTimeField(verbose_name='Дедлайн') + + def __str__(self): + return f'{self.task_text} {self.state} {self.deadline}' diff --git a/to_do_list/to_do/views/__init__.py b/to_do_list/to_do/views/__init__.py new file mode 100644 index 0000000..e69de29