def handle(self, *args, **options): for feed_url in Feed.site_objects.all().values_list("url", flat=True): # process feed in create-mode self.stdout.write("Scheduling feed with URL=%s..." % feed_url) process_feed.delay(feed_url, create=False) feeds_updated.send(sender=self, instance=self)
def handle(self, *args, **options): if not len(args): print("You must provide the feed url as parameter") exit(0) feed_url = args[0] # process feed in create-mode process_feed.delay(feed_url, create=False)
def handle(self, *args, **options): if not len(args): self.stderr.write("You must provide the feed url as parameter") exit(0) feed_url = args[0] # process feed in create-mode process_feed.delay(feed_url, create=True, category_title=options['category']) self.stdout.write("Feed created. Posts scheduled to be retrived soon.")
def handle(self, *args, **options): feed_url = options.get('feed_url', None) if not feed_url: print("You must provide the feed url as parameter") exit(0) # process feed in create-mode process_feed.delay(feed_url, create=False)
def form_valid(self, form): try: instance = form.instance create = False except: create = True owner_id = self.request.user.id process_feed.delay(form.cleaned_data["url"], owner_id=owner_id, create=create) self.request.session["feed_created"] = True return super(FeedFormView, self).form_valid(form)
def handle(self, *args, **options): feed_url = options.get('feed_url', None) if not feed_url: print("You must provide the feed url as parameter") exit(0) # process feed in create-mode process_feed.delay(feed_url, create=True, category_title=options['category']) self.stdout.write("Feed created. Posts scheduled to be retrived soon.")
def form_valid(self, form): try: instance = form.instance create = False except: create = True owner_id = self.request.user.id process_feed.delay(form.cleaned_data['url'], owner_id=owner_id, create=create) self.request.session['feed_created'] = True return super(FeedFormView, self).form_valid(form)
def handle(self, *args, **options): for feed_url in Feed.site_objects.all().values_list("url", flat=True): if ASYNC_BACKEND == "celery": self.stdout.write("Scheduling feed with URL=%s..." % feed_url) process_feed.delay(feed_url, create=False) elif ASYNC_BACKEND == "huey": from planet.tasks import huey_process_feed huey_process_feed(feed_url, create=False) else: process_feed(feed_url, create=False) feeds_updated.send(sender=self, instance=self) return
def handle(self, *args, **options): if not len(args): self.stderr.write("You must provide the feed url as parameter") exit(0) feed_url = args[0] # process feed in create-mode if ASYNC_BACKEND == "celery": process_feed.delay(feed_url, create=True, category_title=options['category']) elif ASYNC_BACKEND == "huey": from planet.tasks import huey_process_feed huey_process_feed(feed_url, create=True, category_title=options['category']) else: process_feed(feed_url, create=True, category_title=options['category']) self.stdout.write("Feed created.")