#13864: DatabaseError while saving with force_update set
---------------------------------------------------+------------------------
          Reporter:  fva                           |         Owner:  nobody     
               
            Status:  reopened                      |     Milestone:             
               
         Component:  Database layer (models, ORM)  |       Version:  1.2        
               
        Resolution:                                |      Keywords:  
force_update DatabaseError
             Stage:  Unreviewed                    |     Has_patch:  0          
               
        Needs_docs:  0                             |   Needs_tests:  0          
               
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Changes (by kmtracey):

  * status:  closed => reopened
  * resolution:  invalid =>

Comment:

 The model was saved, in step 4. It does have a PK:

 {{{
 #!python
 >>> from ttt.models import B
 >>> b = B()
 >>> b.pk
 >>> b.a
 >>> b.save()
 >>> b.pk
 2
 >>> b.a
 >>> b.save(force_update=True)
 Traceback (most recent call last):
   File "<console>", line 1, in <module>
   File "C:\u\kmt\django\trunk\django\db\models\base.py", line 435, in save
     self.save_base(using=using, force_insert=force_insert,
 force_update=force_update)
   File "C:\u\kmt\django\trunk\django\db\models\base.py", line 503, in
 save_base
     raise DatabaseError("Forced update did not affect any rows.")
 DatabaseError: Forced update did not affect any rows.
 >>>
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13864#comment:2>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to