Changes between Initial Version and Version 1 of Ticket #14295


Ignore:
Timestamp:
09/15/2010 07:18:04 PM (5 years ago)
Author:
Alex
Comment:

I've reformatted the description of this ticket, in the future you can use the "Preview" button to ensure that your message is formatted the way you intended.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14295

    • Property Patch needs improvement unset
    • Property Needs tests unset
    • Property Needs documentation unset
  • Ticket #14295 – Description

    initial v1  
    44
    55When properties of an inactive object are updated and the inactive object is saved, an IntegrityError is raised. This is because the default manager cannot find the object and attempts to insert the object again instead of updating it.
    6 
     6{{{
    77class MyModelManager(models.Manager):
    88   def get_query_set(self):
     
    2525m.save()
    2626--> IntegrityError!!!
    27 
     27}}}
    2828I would like that the default manager can be set such that inactive objects are not shown (i.e. also not when using mymodel_set on related objects) such that by default the inactive objects are not taken into account. However, to avoid the IntegrityError when saving an object I would like to be capable of overruling a manager that has to be used by save (and most likely also by delete), in the model and/or as in argument in the save call.
Back to Top