#5450: save_m2m should raise an exception for unsaved models
---------------------------------------------------------+------------------
          Reporter:  Øyvind Saltvik <[EMAIL PROTECTED]>  |         Owner:  
nobody
            Status:  new                                 |     Milestone:       
 
         Component:  Uncategorized                       |       Version:  SVN  
 
        Resolution:                                      |      Keywords:       
 
             Stage:  Accepted                            |     Has_patch:  0    
 
        Needs_docs:  0                                   |   Needs_tests:  0    
 
Needs_better_patch:  0                                   |  
---------------------------------------------------------+------------------
Comment (by anonymous):

 Replying to [comment:3 jacob]:
 > Agreed with Russell -- save_m2m() is very specific to that instance;
 better behavior would be to raise an error if the object doesn't have a
 pk. I'm coopting this ticket to handle that issue instead.

 Just checking if pk is set isn't a good solution too because it can be set
 programmatically before save() is called. It is definitely needed to have
 some kind of read-only attribute, say Model.in_db, telling whether model
 has been really saved (or read from) db.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5450#comment:4>
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