From 49faeb5221517a4e328e0766f50416c748d7724d Mon Sep 17 00:00:00 2001 From: Artur Galyamov Date: Wed, 28 Dec 2022 11:15:11 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D0=B5=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D0=B2=D0=BE?= =?UTF-8?q?=D0=B4=D0=B0=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D0=B8=20=D0=B1?= =?UTF-8?q?=D0=B5=D0=B7=20=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=BF=D0=BE=20=D1=83=D0=BC=D0=BE=D0=BB=D1=87=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8E,=20=D1=81=20placeholder=20=D0=B8=20=D0=BE=D0=B1?= =?UTF-8?q?=D1=8F=D0=B7=D0=B0=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D0=BE=D0=B5=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=B7=D0=B0=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20#31?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cms/forms.py | 3 +++ cms/migrations/0004_alter_article_link.py | 18 ++++++++++++++++++ cms/models.py | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 cms/migrations/0004_alter_article_link.py diff --git a/cms/forms.py b/cms/forms.py index c021d80..8c88139 100644 --- a/cms/forms.py +++ b/cms/forms.py @@ -5,6 +5,9 @@ from .models import Article class ArticleForm(forms.ModelForm): + link_widget = forms.TextInput(attrs={'placeholder': 'Введите ссылку новости'}) + link = forms.CharField(widget=link_widget) + class Meta: model = Article fields = ('body', 'link',) diff --git a/cms/migrations/0004_alter_article_link.py b/cms/migrations/0004_alter_article_link.py new file mode 100644 index 0000000..5f3fe7e --- /dev/null +++ b/cms/migrations/0004_alter_article_link.py @@ -0,0 +1,18 @@ +# Generated by Django 4.1.4 on 2022-12-28 06:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms', '0003_alter_article_link'), + ] + + operations = [ + migrations.AlterField( + model_name='article', + name='link', + field=models.CharField(max_length=200), + ), + ] diff --git a/cms/models.py b/cms/models.py index e7f00a5..0f8b76a 100644 --- a/cms/models.py +++ b/cms/models.py @@ -3,4 +3,4 @@ from django.db import models class Article(models.Model): body = models.TextField(null=False) - link = models.CharField(max_length=200, default='https://zakonvremeni.ru/news/') + link = models.CharField(max_length=200, null=False) -- 2.11.0