summaryrefslogtreecommitdiff
path: root/app/gtd/management/commands
diff options
context:
space:
mode:
Diffstat (limited to 'app/gtd/management/commands')
-rw-r--r--app/gtd/management/commands/rss_updater.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/app/gtd/management/commands/rss_updater.py b/app/gtd/management/commands/rss_updater.py
index 41ffa99..0f3796b 100644
--- a/app/gtd/management/commands/rss_updater.py
+++ b/app/gtd/management/commands/rss_updater.py
@@ -6,8 +6,7 @@ from urllib.parse import urlparse
from django.contrib.auth import get_user_model
-from posts.models import PostStatus, Post
-User = get_user_model()
+from gtd.models import PostStatus, WiredPost
"""
run from a cronscript that looks line this:
@@ -31,7 +30,7 @@ class Command(BaseCommand):
if story_type == "story" or "gallery":
if not self.is_deal(item.tags):
try:
- post = Post.objects.get(url=item.link)
+ post = WiredPost.objects.get(url=item.link)
post.date_last_pub = datetime.datetime.strptime(item.published, '%a, %d %b %Y %H:%M:%S %z').date()
post.post_status = PostStatus.PUBLISHED
post.save()
@@ -40,16 +39,21 @@ class Command(BaseCommand):
)
except:
continue
+
+
+
+
+
+'''
if story_type == "review":
"""
TODO: add first and last names so I have everyone in the DB
Then parse and add reviews, but change views so we don't see them
in views where we just want a list of guides to update
"""
- user = User.objects.get(firstname=item.author.split(" ")[0],lastname=item.author.split(" ")[1])
dt = datetime.datetime.strptime(item.published, '%a, %d %b %Y %H:%M:%S %z').date()
- post = Post.objects.get(url=item.link)
+ post = WiredPost.objects.get(url=item.link)
user = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, on_delete=models.SET_NULL)
title = models.CharField(max_length=512, blank=True, null=True)
@@ -65,3 +69,4 @@ class Command(BaseCommand):
needs_update = models.BooleanField(default=False)
is_live = models.BooleanField(default=True)
post_status = models.IntegerField(choices=PostStatus.choices, default=PostStatus.PUBLISHED)
+'''