diff options
author | Stephen Finucane <stephen@that.guru> | 2017-05-18 21:17:41 +0100 |
---|---|---|
committer | Stephen Finucane <stephen@that.guru> | 2017-05-18 21:17:41 +0100 |
commit | 8585ea5afec383c9c5622843bcff0e6c448614c7 (patch) | |
tree | 01b2f558c193883e4c1bd34c0183f253ff8f9d7e | |
parent | c265e0fd9588030ab8bcff1e4f27be941511aca4 (diff) | |
download | patchwork-8585ea5afec383c9c5622843bcff0e6c448614c7.tar patchwork-8585ea5afec383c9c5622843bcff0e6c448614c7.tar.gz |
models: Use 'base_manager_name'
This raises warnings in Django 1.10 and will be required in Django 1.11.
We also set 'silence_use_for_related_fields_deprecation' to allow us to
retain the current behavior on versions of Django < 1.10.
Signed-off-by: Stephen Finucane <stephen@that.guru>
-rw-r--r-- | patchwork/models.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/patchwork/models.py b/patchwork/models.py index 7ca64ab..725d0b0 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -270,6 +270,9 @@ class PatchQuerySet(models.query.QuerySet): class PatchManager(models.Manager): use_for_related_fields = True + # NOTE(stephenfin): This is necessary to silence a warning with Django >= + # 1.10. Remove when 1.10 is the minimum supported version. + silence_use_for_related_fields_deprecation = True def get_queryset(self): return PatchQuerySet(self.model, using=self.db) @@ -537,6 +540,7 @@ class Patch(SeriesMixin, Submission): class Meta: verbose_name_plural = 'Patches' + base_manager_name = 'objects' class Comment(EmailMixin, models.Model): |