From b19655bf6e6855a75a73d24c2b8de315518f055d Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sat, 23 Jul 2022 15:47:14 -0500 Subject: jrnl: removed issue requirement from models and admin and lttr --- app/lttr/models.py | 6 +----- app/posts/admin.py | 2 +- app/posts/migrations/0020_remove_post_issue.py | 17 +++++++++++++++++ app/posts/models.py | 9 --------- app/trading/templates/trading/base.html | 2 +- app/trading/templates/trading/list.html | 3 ++- 6 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 app/posts/migrations/0020_remove_post_issue.py (limited to 'app') diff --git a/app/lttr/models.py b/app/lttr/models.py index b4d1506..22341fa 100644 --- a/app/lttr/models.py +++ b/app/lttr/models.py @@ -249,16 +249,12 @@ class NewsletterMailing(models.Model): self.body_markdown = self.post.body_markdown self.pub_date = self.post.pub_date self.featured_image = self.post.featured_image - if self.post.issue: - self.issue = self.post.issue - else: - self.issue = NewsletterMailing.objects.filter(newsletter=self.newsletter).latest().issue+1 + self.issue = NewsletterMailing.objects.filter(newsletter=self.newsletter).latest().issue+1 if not created: md = render_images(self.body_markdown) self.body_html = markdown_to_html(md) self.body_email_html = markdown_to_emailhtml(self.body_html) self.date_created = timezone.now() - self.issue = self.post.issue if created and not self.featured_image: self.featured_image = LuxImage.objects.latest() super(NewsletterMailing, self).save() diff --git a/app/posts/admin.py b/app/posts/admin.py index 8346c62..22c7955 100644 --- a/app/posts/admin.py +++ b/app/posts/admin.py @@ -45,7 +45,7 @@ class PostAdmin(OSMGeoAdmin): ('title', 'short_title'), 'subtitle', 'body_markdown', - ('pub_date', 'status', 'post_type', 'issue'), + ('pub_date', 'status', 'post_type'), ('slug', 'enable_comments',), 'point', 'dek', diff --git a/app/posts/migrations/0020_remove_post_issue.py b/app/posts/migrations/0020_remove_post_issue.py new file mode 100644 index 0000000..aa5695c --- /dev/null +++ b/app/posts/migrations/0020_remove_post_issue.py @@ -0,0 +1,17 @@ +# Generated by Django 4.0.6 on 2022-07-23 16:29 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('posts', '0019_auto_20210323_2155'), + ] + + operations = [ + migrations.RemoveField( + model_name='post', + name='issue', + ), + ] diff --git a/app/posts/models.py b/app/posts/models.py index 21dd6d5..4616ad5 100644 --- a/app/posts/models.py +++ b/app/posts/models.py @@ -94,7 +94,6 @@ class Post(models.Model): originally_published_by_url = models.CharField(max_length=400, null=True, blank=True) field_notes = models.ManyToManyField('self', blank=True, symmetrical=False, limit_choices_to = {'post_type': PostType.FIELD_NOTE}) books = models.ManyToManyField(Book, blank=True) - issue = models.PositiveIntegerField(null=True) class Meta: ordering = ('-pub_date',) @@ -126,14 +125,6 @@ class Post(models.Model): def get_content_type(self): return ContentType.objects.get(app_label="posts", model="post") - def get_issue_str(self): - issue = self.issue - if self.issue < 100: - issue = "0%s" % self.issue - if self.issue < 10: - issue = "00%s" % self.issue - return issue - @property def get_previous_published(self): return self.get_previous_by_pub_date(status__exact=1,post_type=self.post_type) diff --git a/app/trading/templates/trading/base.html b/app/trading/templates/trading/base.html index 9b9e6b0..ae634a4 100644 --- a/app/trading/templates/trading/base.html +++ b/app/trading/templates/trading/base.html @@ -16,7 +16,7 @@ Home Test Trade Test Options - Wanderer + Wanderer Trading View Tastyworks Schwab New Trade diff --git a/app/trading/templates/trading/list.html b/app/trading/templates/trading/list.html index 3063533..1593caa 100644 --- a/app/trading/templates/trading/list.html +++ b/app/trading/templates/trading/list.html @@ -1,7 +1,7 @@ {% extends 'trading/base.html' %} {% block content %} -

Options

+ {%comment%}

Options

@@ -78,6 +78,7 @@
+ {% endcomment %} {% comment %}

Options Trades

-- cgit v1.2.3-70-g09d2