I'm trying to add an extra field to a select statement in django, In which I want to use a varying format string.
The following results in:
Incorrect number of bindings supplied. The current statement uses 3, and there are 4 supplied.
select=SortedDict([(
"groupkey",
"strftime('%s', datetime(time, 'utc'),'localtime')")]),
select_params=(
"%m"
)
This way I get:
unsupported format character 'm' (0x6d) at index 19 when using %m as a format string. It seems to work when using %%m as a format string but I don't consider this as a nice solution.
select={
"groupkey":"strftime('" + self.__formatstring + "', datetime(time, 'utc'),'localtime')"
})
Thank you!