I’m cocking this up and it should be really simple but the value of sortdate is none (note im only doing this because converting a string to a date in Python is a bugger).
DateToPass = str(self.request.get('startdate'))
mybreak.startdate = DateToPass
faf = DateToPass.split('-')
sortdate = str(faf[2] + faf[1] + faf[0])
That should work? but its just being stored as null though the datetopass is being stored fine.
If your input date is in the format ‘YYYY-MM-DD’ then the code you have shold work fine. There are a few extraneous str() calls, and yeah, it’d be more proper to use strptime, but nothing that should break.
For example, this works:
So the two places I’d look are: