Re: Reset Demo Database Data (with Dates)

2013-04-14 Thread Joey Espinosa
Well I'll be giving this a shot maybe this week. You might be getting some pull requests ;) -- Joey "JoeLinux" Espinosa Python Developer http://about.me/joelinux On Apr 14, 2013 8:09 AM, "Tom Evans" wrote: > On Sun, Apr 14, 2013 at 7:15 AM, Joey Espinosa > wrote: > > > > Did you just write that

Re: Reset Demo Database Data (with Dates)

2013-04-14 Thread Tom Evans
On Sun, Apr 14, 2013 at 7:15 AM, Joey Espinosa wrote: > > Did you just write that or you happened to find what my own Google Fu could > not? If the former, then I owe you a beer. I'll definitely give this a shot > on Monday. Thanks! > Yeah, I got intrigued :) It's only 60 lines or so, and I thi

Re: Reset Demo Database Data (with Dates)

2013-04-13 Thread Joey Espinosa
Did you just write that or you happened to find what my own Google Fu could not? If the former, then I owe you a beer. I'll definitely give this a shot on Monday. Thanks! -- Joey "JoeLinux" Espinosa* *

Re: Reset Demo Database Data (with Dates)

2013-04-13 Thread Tom Evans
On Sat, Apr 13, 2013 at 12:25 PM, Joey Espinosa wrote: > Thanks, Tom. I'm familiar with fixtures. My problem is that I don't know > which fields exactly will be date fields (so I have to check each model for > those fields), and then increment them according to the current date (which > will chang

Re: Reset Demo Database Data (with Dates)

2013-04-13 Thread Joey Espinosa
Thanks, Tom. I'm familiar with fixtures. My problem is that I don't know which fields exactly will be date fields (so I have to check each model for those fields), and then increment them according to the current date (which will change every day). So if a demo happens on the 9th, and my field is

Re: Reset Demo Database Data (with Dates)

2013-04-12 Thread Tom Evans
On Fri, Apr 12, 2013 at 8:00 PM, Joey Espinosa wrote: > > Hey guys, > > I have a situation where I have test data that has been entered into a > demo database (MySQL). During the demo of the app with a customer, data will > be altered. After the demo is complete, I need to "reset" the demo data ba

Re: Reset Demo Database Data (with Dates)

2013-04-12 Thread Joey Espinosa
Nick, Well, you're right, the interval would depend on how old the application is. I'd rather do this through the ORM so that I can check each field to see if it's the appropriate type (DateTimeField), since I don't know exactly which fields I'll be working on (I know, it's pretty ridiculous). I h

Re: Reset Demo Database Data (with Dates)

2013-04-12 Thread Nick D
Joe, I'm new to Django but I do have some SQL experience. Couldn't you just run a statement similar to the following? update mytable set date1 = DATE_ADD(date1, INTERVAL 1 DAY) The pinch point here is the fact that you would have to update the interval based on how old the application is. T