This seems to run for a few thousand records then dies on its arse
import datetime
import time
from google.appengine.ext import db
from google.appengine.tools import bulkloader
from google.appengine.api import datastore_types
class SearchRec(db.Model):
WebSite = db.StringProperty()
WebPage = db.StringProperty()
DateStamp = db.DateTimeProperty(auto_now_add=True)
IP = db.StringProperty()
UserAgent = db.StringProperty()
class TrackerExporter(bulkloader.Exporter):
def __init__(self):
bulkloader.Exporter.__init__(self, 'SearchRec',
[('WebSite', str, None),
('WebPage', str, None),
('DateStamp', lambda x: str(datetime.datetime.strptime(x, '%d/%m/%Y').date()), None),
('IP', str, None)
])
exporters = [TrackerExporter]
if __name__ == '__main__':
bulkload.main(TrackerExporter)
Error>>
File "tracker-export.py", line 89, in <lambda>
('DateStamp', lambda x: str(datetime.datetime.strptime(x, '%d/%m/%Y').date()
), None),
TypeError: strptime() argument 1 must be string, not datetime.datetime
The errors going to drive me mental as (counting the dots) its gone through 42200 records before falling over...
Help!