#3060 closed defect (fixed)
[patch] broken Timestamp on manual created Users using postgres/sqlite
Reported by: | Ronny Pfannschmidt | Owned by: | nobody |
---|---|---|---|
Component: | Contrib apps | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
while adding a entry for unregistred Users i noticed, that the Model wont use correct timestamps for:
User.objects.get_or_create(username="UnReg",defaults={'id':-1})
,since its using LazyDate as default, wich does only the Date,
unfortunately Mysql is the only supported dbms accepted this, so i added a auto_now_add=True, wich resulted in sqlite and postgresql working, too
Attachments (1)
Change History (8)
by , 18 years ago
Attachment: | auth-timestamp-patch.diff added |
---|
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Component: | Contrib apps → Admin interface |
---|---|
Triage Stage: | Unreviewed → Ready for checkin |
comment:3 by , 18 years ago
Component: | Admin interface → Contrib apps |
---|
comment:4 by , 18 years ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
Triage Stage: | Ready for checkin → Accepted |
Could we get a unit test that verifies this? Also, what exactly does "broken timestamp" mean? Finally, I'm not in favor of the patch, because auto_now_add
is a hack that I'd like to get rid of eventually. If nothing else, it should use default=datetime.datetime.now
, taking advantage of the callable default functionality.
comment:5 by , 18 years ago
some dbms didnt accept the date from lazydate - but default=datetime.now is a better solution
comment:6 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Looks to me like this was solved in [4985], when LazyDate was pulled.
Please reopen if this didn't fix it for you, but it sounds like you were happy with the solution used to replace LazyDate.
comment:7 by , 17 years ago
Reporter: | changed from | to
---|
test