Skip to content

Commit 4a95b35

Browse files
committed
Add deprecated decorator to methods [skip ci]
1 parent 93ec630 commit 4a95b35

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

poetry.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ classifiers = [
2626
"Environment :: Web Environment",
2727
"Operating System :: OS Independent",
2828
"Development Status :: 5 - Production/Stable",
29+
"Typing :: Typed",
2930
"Framework :: Django",
3031
"Framework :: Django :: 2.0",
3132
"Framework :: Django :: 3.0",
@@ -37,7 +38,7 @@ classifiers = [
3738
python = "^3.8"
3839
Django = ">=2,<6"
3940
pydantic = "*"
40-
typing-extensions = "*"
41+
typing-extensions = "^4.5"
4142

4243
[tool.poetry.group.build.dependencies]
4344
django-bootstrap3 = "^21.2"

src/bootstrap_datepicker_plus/_base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from django import forms
66
from django.forms.widgets import DateTimeBaseInput
7+
from typing_extensions import deprecated
78

89
from ._config import WidgetConfig
910
from .schemas import InputAttrs, WidgetOptions, WidgetVariant
@@ -79,6 +80,9 @@ def get_context(
7980
context["addon_icon_class"] = settings.addon_icon_classes[self.variant]
8081
return context
8182

83+
@deprecated(
84+
"Use 'range_from' instead. See https://github.com/monim67/django-bootstrap-datepicker-plus"
85+
)
8286
def start_of(self, event_id: str) -> "BasePickerInput":
8387
"""Set Date-Picker as the start-date of a date-range (Deprecated!!!)."""
8488
warnings.warn(
@@ -89,6 +93,9 @@ def start_of(self, event_id: str) -> "BasePickerInput":
8993
self.attrs["data-dbdp-start"] = event_id
9094
return self
9195

96+
@deprecated(
97+
"Use 'range_from' instead. See https://github.com/monim67/django-bootstrap-datepicker-plus"
98+
)
9299
def end_of(self, event_id: str, import_options: bool = True) -> "BasePickerInput":
93100
"""Set Date-Picker as the end-date of a date-range (Deprecated!!!)."""
94101
warnings.warn(

0 commit comments

Comments
 (0)