#12685: Serialized objects' save function does not respect force_insert
---------------------------------------------------+------------------------
          Reporter:  dcotruta                      |         Owner:  nobody
            Status:  closed                        |     Milestone:        
         Component:  Database layer (models, ORM)  |       Version:  1.1   
        Resolution:  invalid                       |      Keywords:        
             Stage:  Unreviewed                    |     Has_patch:  0     
        Needs_docs:  0                             |   Needs_tests:  0     
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Changes (by russellm):

  * status:  new => closed
  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0
  * resolution:  => invalid

Old description:

> Given a serialized trivial object, of the type models.Model, which does
> not override any functions, a deserialized object does not accept the
> force_insert keyword argument for its save function.
>
> class XYZ(models.Model):
>     xyz_creation_date = models.DateTimeField(verbose_name=_("Date
> Opened"),
>                                          blank=False,
>                                          auto_now_add=True,
>                                          editable=False
>                                          )
>
>     xyz_is_open = models.BooleanField(default=True)
>
>     xyz_last_updated = models.DateTimeField(verbose_name=_("Last
> Report"),
>                                         blank=False,
>                                         auto_now=True
>                                         )
>
>     xyz_synced = models.BooleanField(default=False)
>
> If this model exists on two separate servers, and instances of this
> object are serialized, passed over the wire, and then deserialized, the
> save function on the receiving server cannot pass force_insert=True -
> doing so yields "save() got an unexpected keyword argument
> 'force_insert'".
>
> Any ideas?

New description:

 Given a serialized trivial object, of the type models.Model, which does
 not override any functions, a deserialized object does not accept the
 force_insert keyword argument for its save function.
 {{{
 class XYZ(models.Model):
     xyz_creation_date = models.DateTimeField(verbose_name=_("Date
 Opened"),
                                          blank=False,
                                          auto_now_add=True,
                                          editable=False
                                          )

     xyz_is_open = models.BooleanField(default=True)

     xyz_last_updated = models.DateTimeField(verbose_name=_("Last Report"),
                                         blank=False,
                                         auto_now=True
                                         )

     xyz_synced = models.BooleanField(default=False)
 }}}
 If this model exists on two separate servers, and instances of this object
 are serialized, passed over the wire, and then deserialized, the save
 function on the receiving server cannot pass force_insert=True - doing so
 yields "save() got an unexpected keyword argument 'force_insert'".

 Any ideas?

Comment:

 Trac is not for asking how-to questions. If you want to know how to do
 something, ask on django-users.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12685#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to