diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2019-08-24 14:57:46 +0200 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2019-08-26 21:37:10 +0200 |
commit | 870060605e3955114766a979de1afadbea4dc603 (patch) | |
tree | 87c6a0e3656ad0eb3758f2b14cfceadde689188b /semantic_version/django_fields.py | |
parent | 5c1abbef4d86bcd1ec68cf5deb90b559faf25502 (diff) | |
download | semantic-version-rba/pre-2.8.tar.gz |
Deprecate support for 'partial' versions.rba/pre-2.8
Their comparison semantics were ill-defined, and mostly an
implementation detail for the old, 'native' specs.
Diffstat (limited to 'semantic_version/django_fields.py')
-rw-r--r-- | semantic_version/django_fields.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/semantic_version/django_fields.py b/semantic_version/django_fields.py index 1af5bf5..db7e606 100644 --- a/semantic_version/django_fields.py +++ b/semantic_version/django_fields.py @@ -2,6 +2,7 @@ # Copyright (c) The python-semanticversion project # This code is distributed under the two-clause BSD License. +import warnings from django.db import models from django.utils.translation import ugettext_lazy as _ @@ -46,6 +47,12 @@ class VersionField(SemVerField): def __init__(self, *args, **kwargs): self.partial = kwargs.pop('partial', False) + if self.partial: + warnings.warn( + "Use of `partial=True` will be removed in 3.0.", + DeprecationWarning, + stacklevel=2, + ) self.coerce = kwargs.pop('coerce', False) super().__init__(*args, **kwargs) |