cleanerversion icon indicating copy to clipboard operation
cleanerversion copied to clipboard

Improve `VersionManager` to using with custom managers

Open tbazadaykin opened this issue 6 years ago • 1 comments

Problem

VersionManager is not friendly enough to custom manager, because of:

  1. get_queryset always return VersionedQuerySet, as result it's impossible to override query set class throut from_queryset method;
  2. get_queryset has some extra code which set querytime property for query set instance. As a result user should copy this two lines - this is not a pythonic way.

Solution

  1. Move querytime-code from queryset method into querytime decorator.
  2. Some VersionManager methods use VersionedQuerySet methods, so we must ensure that they has deal with VersionedQuerySet or it's subclass. If not - we must warned user about potential problems.

tbazadaykin avatar Apr 19 '18 09:04 tbazadaykin

Btw, why you add Vagrantfile into .gitignore?

tbazadaykin avatar Apr 19 '18 09:04 tbazadaykin