Petar,

how was your object added? I had that problem when using the create 
function and save, for example using the model:

class B(models.Model):
    date = models.DateField(auto_now_add=True)
    a = models.ForeignKey(A)

doing this considering "object" is an object of class A, this produces 
the error,

object.b_set.create().save()


but:


object.b_set.create()


does the trick, i think that the first one shouldn't be used, i left it 
like that while changing code to use the Magic-Removal version of 
django. I hope this also helps you.

--
Fernando Gutierrez H.
http://www.aureal.com.pe


Petar Marić wrote:
> class Paper(models.Model):
>     # ...
>     submited_on = models.DateField(
>         auto_now_add=True,
>     )
>     # ...
>
> The above will spit out:
> Exception Type:       ValueError
> Exception Value:      year is out of range
> Exception Location:
>       C:\Dev\Python24\lib\site-packages\MySQLdb\connections.py in
> defaulterrorhandler, line 33
>
> The saved value of submited_on for the corresponding Paper is
> '0000-00-00' which is horribly wrong ;)
>
> I'm using MySQL 4.1.12a-nt and freshly baked django svn copy
> --
> Petar Marić
> *e-mail: [EMAIL PROTECTED]
> *mobile: +381 (64) 6122467
>
> *icq: 224720322
> *skype: petar_maric
> *web: http://www.petarmaric.com/
>
> >
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to