From 998dea4a4cbc7643f5c4a3e2e1fa846ce174c111 Mon Sep 17 00:00:00 2001 From: vas3k Date: Wed, 22 Jan 2020 16:32:53 +0100 Subject: [PATCH] Make URL field customizable --- boards.yml | 16 +++++++------- boards/migrations/0007_auto_20200122_1526.py | 23 ++++++++++++++++++++ boards/models.py | 4 ++-- templates/board.html | 2 +- 4 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 boards/migrations/0007_auto_20200122_1526.py diff --git a/boards.yml b/boards.yml index bbbc7cc..cd4abdc 100644 --- a/boards.yml +++ b/boards.yml @@ -87,14 +87,14 @@ boards: url: https://readwrite.com rss: https://readwrite.com/feed/ - name: Микс блогов - slug: the_mix - feeds: - - url: http://www.rssmix.com/ - rss: http://www.rssmix.com/ - columns: 3 - mix: - - http://vas3k.ru/rss/ - - http://nedbatchelder.com/blog/rss.xml + slug: the_mix + feeds: + - url: http://www.rssmix.com/ + rss: http://www.rssmix.com/ + columns: 3 + mix: + - http://vas3k.ru/rss/ + - http://nedbatchelder.com/blog/rss.xml - name: Мейнстрим slug: mainstream feeds: diff --git a/boards/migrations/0007_auto_20200122_1526.py b/boards/migrations/0007_auto_20200122_1526.py new file mode 100644 index 0000000..9351e05 --- /dev/null +++ b/boards/migrations/0007_auto_20200122_1526.py @@ -0,0 +1,23 @@ +# Generated by Django 2.2.8 on 2020-01-22 15:26 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('boards', '0006_boardfeed_conditions'), + ] + + operations = [ + migrations.AlterField( + model_name='board', + name='curator_bio', + field=models.TextField(null=True), + ), + migrations.AlterField( + model_name='board', + name='curator_url', + field=models.TextField(null=True), + ), + ] diff --git a/boards/models.py b/boards/models.py index a5ee7f2..8d89635 100644 --- a/boards/models.py +++ b/boards/models.py @@ -18,8 +18,8 @@ class Board(models.Model): curator_name = models.CharField(max_length=120) curator_title = models.CharField(max_length=120, null=True) - curator_url = models.URLField(null=True) - curator_bio = models.CharField(max_length=120, null=True) + curator_url = models.TextField(null=True) + curator_bio = models.TextField(null=True) curator_footer = models.TextField(null=True) schema = models.TextField(null=True) diff --git a/templates/board.html b/templates/board.html index 4f95c6f..554b177 100644 --- a/templates/board.html +++ b/templates/board.html @@ -26,7 +26,7 @@ {% if board.curator_url %}
- 👉 от {{ board.curator_url|pretty_url }} + 👉 {{ board.curator_url|safe }}
{% endif %}