I'd like to add a scheduling option to allow user to manually input a date and time that would delay their post to be published to that specific date/time. So if the user uploads five posts in one day but only wants to publish one per day, then they could input a specific date and time for each post to be published (i.e. Post #1 publish on 1/8/18 3:30pm, Post #2 publish on 1/13/18 4:00pm, etc.)
Thinking about using Celery to approach this problem. Having trouble visualizing how to connect Celery Tasks to the Post Form (or Model) so user can have the option to adjust the timing according to their scheduling needs. If you could explain with visual examples and where the examples are taking place (i.e. views.py, etc.) that would be greatly appreciated. Thanks!
Related
I want to create a Designer Workflow in 2013 which will trigger the email automatically for 5 times in a month. List is same but the calculation and logic is different for every email. First time, i can initiate the process to send the email (ex-creating a button to initiate) then email will be sent after 2 days then after 4 days resp
For this, i used 2 things-
HTTP Web Service call- but it is giving me unexpected error. Even I am not able to fetch the list records.
created a JavaScript with set Timeout function. But the problem is How and where to deploy and schedule this script so it will run till the last email and trigger it automatically after some days based on the logic.
can anyone help me please?
or if there are any other solution, please share.
You cannot put JavaScript into a workflow. SharePoint Designer 2013 Workflows have two built-in actions that will allow you to make it wait for a specified time.
Pause for Duration - allows you to specify a length of time to wait before executing the next step.
Pause until Date - allows you to specify a specify date/time in the future that the workflow should pause until that that date/time is reached.
I have a model of student with event date time and student's email field.
I want to send a reminder email 12hours before event time to student's email. What are the ways to achieve this?
You'll need a scheduler for this. Celery is one of the most popular tools used for such tasks with Django.
With celery, you can set a certain task to run at a given time like so:
send_reminder_email.apply_async(eta=datetime_object)
You can read more details here: http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
I have Model "Task" and DateTimeField "deadline" in it. How can I monitor current time and execute some actions (like sending notifications to user, that own that task) when there is, for example, 1 hour left to deadline, or deadline has already come?
I'm using Django 2.0.
I've already read about Celery, but I'm not sure whether it is an appropriate solution for such task.
I'll be glad to hear your opinions.
I'm new to SharePoint but most of it seems pretty straight forward but I've hit a problem and haven't been able to find a way around it so far.
I'm trying to set/enforce Service Level Agreements (SLA's) for different departments based on the department the task is assigned to. I was going to do this based on the workflow status that generates the task but am open to any other suggestions.
My workflow for requesting funds for an approved project goes through several stages (Project management validation, Finance Admin validation; Finance manager validation, Fixed assets authorization) and each one has a slightly different SLA. For this reason, I cant just add an arbitrary value to the start date for the calculated column associated to the task.
Any suggestions?
The option I'd go with here is to use If/Then blocks in my workflow code based on the current stage. Something like this:
If Stage = Project Management Validation Then
Set DueDate to Today+5
Else If Stage = Finance Admin Validation Then
Set DueDate to Today+3
etc.
Hope this helps!
I have a Django application.
One of my models looks like this:
class MyModel(models.Model):
def house_cleaning(self):
// cleaning up data of the model instance
Every time when I update an instance of MyModel, I'd need to clean up the data N days later. So I'd like to schedule a job to call
this_instance.house_cleaning()
N days from now.
Is there any job queue that would allow me to:
Integrate well with Django - allow me to call a method of individual model instances
Only run jobs that are scheduled to run today
Ideally handle failures gracefully
Thanks
django-chronograph might be good for your use case. If you write your cleanup jobs as django commands, then you schedule them to run at some time. It runs using unix cron behind the scene.
Is there any reason why a cron job wouldn't work? Or something like django-cron that behaves the same way? It's pretty easy to write stand-alone Django scripts. If you want to trigger house cleaning on some change to you model after a certain number of days, why not create a date flag in the model which is set to N days in the future when the job needs to be scheduled? You could run a script on a daily basis which pulls all records where the date is <= today, calls the instance's house_cleaning() method and then clears the date field. If an exception is raised during the process, it's easy enough to log it or dispatch an email.