Re: [web2py] A schedule automatic delete from Database

2019-06-10 Thread Lovedie JC
Welcome On Mon, 10 Jun 2019, 17:45 mostwanted wrote: > Thanks alot @Lovedie JC, I get now, i figured out how to use it. > > On Monday, June 10, 2019 at 11:27:27 AM UTC+2, Lovedie JC wrote: >> >> Further more the request.now which works with the time the item is posted >> can also be variable

Re: [web2py] A schedule automatic delete from Database

2019-06-10 Thread mostwanted
Thanks alot @Lovedie JC, I get now, i figured out how to use it. On Monday, June 10, 2019 at 11:27:27 AM UTC+2, Lovedie JC wrote: > > Further more the request.now which works with the time the item is posted > can also be variable with a different dates i.e if you want an item posted > 1 week

Re: [web2py] A schedule automatic delete from Database

2019-06-10 Thread Lovedie JC
Further more the request.now which works with the time the item is posted can also be variable with a different dates i.e if you want an item posted 1 week ago, you can use the datetime function to select the date one week ago and choose the date of deleting using timedelta(days =number) Regards

Re: [web2py] A schedule automatic delete from Database

2019-06-10 Thread Lovedie JC
Is it on the same table? If yes, then you can select with the ID. In the example above the delete is for a post that has lasted one day. If for example a post lasts 3 days then timedelta(days=3), so you decide on the number of days you want for each post. On Mon, 10 Jun 2019, 12:16 mostwanted

Re: [web2py] A schedule automatic delete from Database

2019-06-10 Thread mostwanted
I am having a hard time figuring out how to calculate for variable number of days, in my app i list job posts which have different closing dates, what i want is for the job post to be deleted a day after its closing date. How can achieve this with your algorithm?? On Sunday, June 9, 2019 at

Re: [web2py] A schedule automatic delete from Database

2019-06-09 Thread Lovedie JC
import datetime yesterday = request.now - datetime.timedelta(days=1) db(db.post.modified_on < yesterday).delete() I hope this helps. You can work around it but worked for me in deleting previous posts up to the previous date. You don't have to manually delete but works automatically. Regards On

Re: [web2py] A schedule automatic delete from Database

2019-06-09 Thread Lovedie JC
Had one, let check my archives. On Sun, 9 Jun 2019, 09:47 mostwanted wrote: > Is there a way to schedule an automatic deleting of content from database > on a specified date? I have an application that I want to delete posts > when we reach specified dates. If anyone is familiar with this,

[web2py] A schedule automatic delete from Database

2019-06-09 Thread mostwanted
Is there a way to schedule an automatic deleting of content from database on a specified date? I have an application that I want to delete posts when we reach specified dates. If anyone is familiar with this, your assistance would be greatly appreciated. Regards Mostwanted -- Resources: -