On 8/20/05, jtm <[EMAIL PROTECTED]> wrote: > I have a mySession class with three DateTimeFields along these lines: > > meta.DateTimeField('session_start', 'Session Start Time', > auto_now_add=True) > [...] > File "D:\python24\lib\site-packages\django\core\meta\fields.py", line > 308, in get_db_prep_save > value = value.replace(microsecond=0) > > TypeError: replace() takes no keyword arguments > > Anyone have any hints about this? I fiddled a little, like putting an > "if not isinstance(value, datetime.datetime): raise TypeError" kind of > thing above line 308, and it was throwing the exception, but I have no > idea how to progress things from there.
Yeah, it looks like the value is a string instead of a datetime object at that point. How did you instantiate the object? Did you pass it strings, or datetime objects, or did you rely on the auto_now_add? > Any tips on the best ways to get debugging output from django when > you're in the browser would be warmly received. I've got Django integrated with pdb in my local copy of the development server, and I'm just trying to figure out the smartest way to do it. Currently it drops into pdb to handle all exceptions when I launch django-admin.py runserver with the "--pdb" option -- but ideally you wouldn't have to pass that, and it should automatically ask you whether you wanted to drop into pdb. Adrian