-
-
Notifications
You must be signed in to change notification settings - Fork 529
Add django.contrib.postgres.forms* #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
asfaltboy
wants to merge
4
commits into
typeddjango:master
from
asfaltboy:add-django.contrib.postgres.forms
Closed
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| from .array import * | ||
| from .hstore import * | ||
| from .jsonb import * | ||
| from .ranges import * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| from typing import Any, Optional | ||
|
|
||
| from django import forms as forms | ||
|
|
||
| class SimpleArrayField(forms.CharField): | ||
| default_error_messages: Any = ... | ||
| base_field: Any = ... | ||
| delimiter: str = ... | ||
| min_length: Any = ... | ||
| max_length: Any = ... | ||
| def __init__(self, base_field: Any, *, delimiter: str = ..., max_length: Optional[Any] = ..., min_length: Optional[Any] = ..., **kwargs: Any) -> None: ... | ||
| def clean(self, value: Any): ... | ||
| def prepare_value(self, value: Any): ... | ||
| def to_python(self, value: Any): ... | ||
| def validate(self, value: Any) -> None: ... | ||
| def run_validators(self, value: Any) -> None: ... | ||
|
|
||
| class SplitArrayWidget(forms.Widget): | ||
| template_name: str = ... | ||
| widget: Any = ... | ||
| size: int = ... | ||
| def __init__(self, widget: Any, size: int, **kwargs: Any) -> None: ... | ||
| @property | ||
| def is_hidden(self): ... | ||
| def value_from_datadict(self, data: Any, files: Any, name: Any): ... | ||
| def value_omitted_from_data(self, data: Any, files: Any, name: Any): ... | ||
| def id_for_label(self, id_: Any): ... | ||
| def get_context(self, name: Any, value: Any, attrs: Optional[Any] = ...): ... | ||
| @property | ||
| def media(self): ... | ||
| def __deepcopy__(self, memo: Any): ... | ||
| @property | ||
| def needs_multipart_form(self): ... | ||
|
|
||
| class SplitArrayField(forms.Field): | ||
| default_error_messages: Any = ... | ||
| base_field: Any = ... | ||
| size: int = ... | ||
| remove_trailing_nulls: Any = ... | ||
| def __init__(self, base_field: Any, size: int, *, remove_trailing_nulls: bool = ..., **kwargs: Any) -> None: ... | ||
| def clean(self, value: Any): ... | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from django import forms | ||
| from typing import Any | ||
|
|
||
| class HStoreField(forms.CharField): | ||
| widget: Any = ... | ||
| default_error_messages: Any = ... | ||
| def prepare_value(self, value: Any): ... | ||
| def to_python(self, value: Any): ... | ||
| def has_changed(self, initial: Any, data: Any): ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from django import forms | ||
| from typing import Any | ||
|
|
||
| class InvalidJSONInput(str): ... | ||
| class JSONString(str): ... | ||
|
|
||
| class JSONField(forms.CharField): | ||
| default_error_messages: Any = ... | ||
| widget: Any = ... | ||
| def to_python(self, value: Any): ... | ||
| def bound_data(self, data: Any, initial: Any): ... | ||
| def prepare_value(self, value: Any): ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| from django import forms | ||
| from django.forms.widgets import MultiWidget | ||
| from typing import Any, Optional | ||
|
|
||
| class BaseRangeField(forms.MultiValueField): | ||
| default_error_messages: Any = ... | ||
| def __init__(self, **kwargs: Any) -> None: ... | ||
| def prepare_value(self, value: Any): ... | ||
| def compress(self, values: Any): ... | ||
|
|
||
| class IntegerRangeField(BaseRangeField): | ||
| default_error_messages: Any = ... | ||
| base_field: Any = ... | ||
| range_type: Any = ... | ||
|
|
||
| class FloatRangeField(BaseRangeField): | ||
| default_error_messages: Any = ... | ||
| base_field: Any = ... | ||
| range_type: Any = ... | ||
|
|
||
| class DateTimeRangeField(BaseRangeField): | ||
| default_error_messages: Any = ... | ||
| base_field: Any = ... | ||
| range_type: Any = ... | ||
|
|
||
| class DateRangeField(BaseRangeField): | ||
| default_error_messages: Any = ... | ||
| base_field: Any = ... | ||
| range_type: Any = ... | ||
|
|
||
| class RangeWidget(MultiWidget): | ||
| def __init__(self, base_widget: Any, attrs: Optional[Any] = ...) -> None: ... | ||
| def decompress(self, value: Any): ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from typing import Any, Mapping | ||
|
|
||
| from django.core.exceptions import ValidationError | ||
|
|
||
| def prefix_validation_error(error: ValidationError, prefix: str, code: str, params: Mapping) -> ValidationError: ... |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If attribute is defined on the base class, no need to define it on every field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 55abc1e