Changes between Initial Version and Version 1 of Ticket #14295
- Timestamp:
- Sep 15, 2010, 7:18:04 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #14295 – Description
initial v1 4 4 5 5 When 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 {{{ 7 7 class MyModelManager(models.Manager): 8 8 def get_query_set(self): … … 25 25 m.save() 26 26 --> IntegrityError!!! 27 27 }}} 28 28 I 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.