Opened 10 years ago

Closed 6 years ago

#3411 closed (wontfix)

[Django Multi DB Tree]: modifying objects via the admin interface generates an operational error

Reported by: jamie@… Owned by: nobody
Component: contrib.admin Version: other branch
Severity: Keywords: admin LogEntry multiple-db-support
Cc: Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Using the Django Multi Database tree, any attempt to modify an object via the admin interface generates the Operational Error (1048, "Column 'action_time' cannot be null") when it attempts to create the django_admin_log log entry.


LogEntry.objects.log_action(, ContentType.objects.get_for_model(model).id, pk_value, str(new_object), ADDITION)

/usr/lib/python2.4/site-packages/django_mdb_src/django/db/backends/ in execute

   5. def __init__(self, cursor, db):
   6. self.cursor = cursor
   7. self.db = db
   9. def execute(self, sql, params=()):
  10. start = time()
  11. try:

  12. return self.cursor.execute(sql, params) ...

  13. finally:
  14. stop = time()
  15. # If params was a list, convert it to a tuple, because string
  16. # formatting with '%' only works with tuples or dicts.
  17. if not isinstance(params, (tuple, dict)):
  18. params = tuple(params)
Local vars
Variable 	Value
(None, 1L, 10L, 3L, 'niner niner', 1, '')
<django.db.backends.util.CursorDebugWrapper object at 0xa943ee8c>
'INSERT INTO `django_admin_log` (`action_time`,`user_id`,`content_type_id`,`object_id`,`object_repr`,`action_flag`,`change_message`) VALUES (%s,%s,%s,%s,%s,%s,%s)'

If I manually attempt to INSERT this SQL with the params fields for values I get the same error. I've diff'ed all the files in the error chain against headrev and django_mdb tree and don't see any glaring obvious differences that would affect this but clearly I'm missing something. I should also note that only changing my site-packages 'django' symlink from django_src ( headrev ) to django_mdb_src ( mdb tree ) the problem goes away.

Change History (6)

comment:1 Changed 10 years ago by lcurrea@…

Keywords: multiple-db-support added
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

I'm having the exact same problem. Just wondering if anyone's had a chance to look into it. Thanks!

comment:2 Changed 9 years ago by slump

you can fix it like this:
change the type of the datetime-field to timestamp with default value CURRENT_TIMESTAMP.

comment:3 Changed 9 years ago by Jacob

Triage Stage: UnreviewedSomeday/Maybe

comment:4 Changed 8 years ago by mrts

milestone: post-1.0

Definitely not in 1.0 scope.

comment:5 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:6 Changed 6 years ago by Mikhail Korobov

Resolution: wontfix
Status: newclosed

This ticket seems to be obsolete.

Note: See TracTickets for help on using tickets.
Back to Top