diff options
Diffstat (limited to 'app/posts')
-rw-r--r-- | app/posts/forms.py | 2 | ||||
-rw-r--r-- | app/posts/migrations/0017_post_edit_url.py | 18 | ||||
-rw-r--r-- | app/posts/models.py | 1 | ||||
-rw-r--r-- | app/posts/templates/posts/post_form.html | 2 |
4 files changed, 21 insertions, 2 deletions
diff --git a/app/posts/forms.py b/app/posts/forms.py index f1b9960..4013040 100644 --- a/app/posts/forms.py +++ b/app/posts/forms.py @@ -16,4 +16,4 @@ class PostUpdateForm(ModelForm): class Meta: model = Post - fields = ['title', 'post_status'] + fields = ['title', 'post_status', 'url', 'template_type', 'update_frequency', 'edit_url', 'date_last_pub'] diff --git a/app/posts/migrations/0017_post_edit_url.py b/app/posts/migrations/0017_post_edit_url.py new file mode 100644 index 0000000..1f7499b --- /dev/null +++ b/app/posts/migrations/0017_post_edit_url.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.2 on 2023-11-01 12:54 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('posts', '0016_post_post_status'), + ] + + operations = [ + migrations.AddField( + model_name='post', + name='edit_url', + field=models.CharField(blank=True, max_length=512, null=True), + ), + ] diff --git a/app/posts/models.py b/app/posts/models.py index b518554..06794be 100644 --- a/app/posts/models.py +++ b/app/posts/models.py @@ -30,6 +30,7 @@ class Post(models.Model): title = models.CharField(max_length=512, blank=True, null=True) body = models.TextField(blank=True, null=True) url = models.CharField(max_length=512, blank=True, null=True) + edit_url = models.CharField(max_length=512, blank=True, null=True) date_last_pub = models.DateField() guid = models.CharField(max_length=512, blank=True, null=True, db_index=True) author = models.CharField(max_length=255, blank=True, null=True) diff --git a/app/posts/templates/posts/post_form.html b/app/posts/templates/posts/post_form.html index 23289fe..35e2959 100644 --- a/app/posts/templates/posts/post_form.html +++ b/app/posts/templates/posts/post_form.html @@ -4,7 +4,7 @@ <form action="" method="post" class="comment-form">{% csrf_token %} {% for field in form %} <fieldset> - {%if field.name == "guide_type" or field.name == "post_status" %}<span class="selector">{{field.label_tag}}</span>{%else%}{{field.label_tag}}{%endif%} + {%if field.name == "guide_type" or field.name == "post_status" or field.name == "template_type" %}<span class="selector">{{field.label_tag}}</span>{%else%}{{field.label_tag}}{%endif%} {%if field.name == "body_markdown"%}<div class="textarea-rounded">{{ field }}</div>{%else%}{{field}}{%endif%} </fieldset> <small class="alert">{% if field.errors %}{{field.errors}}{% endif %}</small> |