Django-monitor / CHANGES.rst

Django-monitor: CHANGE LOG


Through the changesets from 18 to 28, we have introduced the following changes to Django-monitor.

  • BUGFIX: Fixed issues upto #4. (Refer to the issues section at bitbucket).
  • This app is now available over python applications index,
  • BUGFIX: was not working as expected. Fixed.
  • The directory, docs/build contained documentation in html format. Since we can build it any time using sphinx, it is removed from the revision control. Now our package contains the documentation in reStructuredText format only (within docs/source).
  • When you create an instance of a model which in turn is a sub-class of another non-abstract model, django creates a parent instance which stores the data that belongs to the parent model. The child instance stores a reference to it plus all additional data. Now django_monitor automatically moderates such parent instances also.
  • Auto-deletion: When you delete a moderated model instance, corresponding monitor entries also get deleted. This includes those monitor entries for parent instances as well.
  • Though the project name is django_monitor, our source directory was named as monitor till 0.1.5. This may lead to failed dependencies for other apps which depend on this. Now we have renamed the directory as django_monitor.


  • Django-monitor contained a bug that pops up when you subclass a moderated model and enqueue that sub-class also for moderation (Ticket #1). When you create an instance for a sub-class of any non-abstract model, django creates corresponding parent class instances too. But no post_save signal is emitted for any of those parent instances. Since moderation is invoked on the post_save signal, no monitor_entry is created for any of those parents. The CustomQueryset we use assumes that a monitor_entry will be there for all moderated model instances. Since it can not find any for the parents, it always return empty rows when you try to access them. Fixed by adding a couple of lines in our monitor.util.save_handler to create monitor_entries for all moderated parent instances as well.


  • Now we have finished implementation of one more TODO things: A single place to manage monitored objects. The model change-link, Moderation Queue, under the app, Monitor in admin-home page leads user to a page listing the counts of pending/challenged objects for each monitored models.
  • ERROR_FIX: In monitor.admin.has_delete_permission, we tried to retrieve the model class as self.opts.model. It should be self.model. Fixed.


  • Now developers can block admin-users from deleting approved objects of desired models. An additional parameter, can_delete_approved, is added to monitor.nq to enable this. Default value is True.


  • Django-monitor now generates a post_moderation signal whenever an object is moderated. Developers can make use of this if they want to invoke some function right after moderation. See docs/dev_howto.rst for details.


  • monitor now contains one more utility function, get_monitor_entry. It will return the monitor_entry that corresponds to the given object. Example:

    import monitor
  • The model, MonitorEntry now supports the following public methods to help developer:

    • approve, challenge and reset_to_pending to moderate objects by code. Combining with get_monitor_entry, a developer may write:

      import monitor
      my_inst = MyModel.objects.create(arg1 = 1)
      # my_inst is in pending status now.
      # Now it got approved.
    • moderate does the same job as above but can be used when the moderation status is not known but stored in some variable.

      # We want to set status of my_inst to the value stored in say, `status`.
    • is_approved, is_challenged and is_pending can be used to make

      sure that the desired object is in some particular moderation status.

  • BUGFIX: There was a bug with our save_handler function which handled the post_save moderation. Whenever an object is saved, the function would invoke moderate_rel_objects which in turn reset status of the objects and all of its related objects to PENDING_STATUS. moderate_rel_objects should be invoked here for newly created objects only. Fixed.

  • The documentation is updated to inlcude new changes in code.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.