django-synchro icon indicating copy to clipboard operation
django-synchro copied to clipboard

Wrong date for last_check in SynchroSettings

Open sneawo opened this issue 10 years ago • 0 comments

In changelog i have a date with millisecond: 2015-01-26 15:00:23.559368 and in dbsettings for last_check without: 2015-01-26 13:26:56. Then it makes an update for remote on every synchronization.

To solve this, i used:

SYNCHRO_DATETIME_INPUT_FORMATS = ('%Y-%m-%d %H:%M:%S.%f',)

class DateTimeMsValue(dbsettings.DateTimeValue):
    formats_source = 'SYNCHRO_DATETIME_INPUT_FORMATS'

class SynchroSettings(dbsettings.Group):
    last_check = DateTimeMsValue('Last synchronization', default=now())

Is there any better solution?

sneawo avatar Jan 26 '15 15:01 sneawo