Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
a3fe4add
Kaydet (Commit)
a3fe4add
authored
Eyl 03, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #23162 -- Removed forms.Field._has_changed() method.
Per deprecation timeline.
üst
491de4f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
15 deletions
+2
-15
fields.py
django/forms/fields.py
+1
-10
test_fields.py
tests/forms_tests/tests/test_fields.py
+1
-5
No files found.
django/forms/fields.py
Dosyayı görüntüle @
a3fe4add
...
...
@@ -28,9 +28,6 @@ from django.forms.widgets import (
)
from
django.utils
import
formats
,
six
from
django.utils.dateparse
import
parse_duration
from
django.utils.deprecation
import
(
RemovedInDjango110Warning
,
RenameMethodsBase
,
)
from
django.utils.duration
import
duration_string
from
django.utils.encoding
import
force_str
,
force_text
,
smart_text
from
django.utils.ipv6
import
clean_ipv6_address
...
...
@@ -48,13 +45,7 @@ __all__ = (
)
class
RenameFieldMethods
(
RenameMethodsBase
):
renamed_methods
=
(
(
'_has_changed'
,
'has_changed'
,
RemovedInDjango110Warning
),
)
class
Field
(
six
.
with_metaclass
(
RenameFieldMethods
,
object
)):
class
Field
(
object
):
widget
=
TextInput
# Default widget to use when rendering this type of Field.
hidden_widget
=
HiddenInput
# Default widget to use when rendering this as "hidden".
default_validators
=
[]
# Default set of validators
...
...
tests/forms_tests/tests/test_fields.py
Dosyayı görüntüle @
a3fe4add
...
...
@@ -44,10 +44,9 @@ from django.forms import (
Textarea
,
TextInput
,
TimeField
,
TypedChoiceField
,
TypedMultipleChoiceField
,
URLField
,
UUIDField
,
ValidationError
,
Widget
,
forms
,
)
from
django.test
import
SimpleTestCase
,
ignore_warnings
from
django.test
import
SimpleTestCase
from
django.utils
import
formats
,
six
,
translation
from
django.utils._os
import
upath
from
django.utils.deprecation
import
RemovedInDjango110Warning
from
django.utils.duration
import
duration_string
try
:
...
...
@@ -568,14 +567,11 @@ class FieldsTests(SimpleTestCase):
f
=
DateField
()
self
.
assertRaisesMessage
(
ValidationError
,
"'Enter a valid date.'"
,
f
.
clean
,
'a
\x00
b'
)
@ignore_warnings
(
category
=
RemovedInDjango110Warning
)
# for _has_changed
def
test_datefield_changed
(
self
):
format
=
'
%
d/
%
m/
%
Y'
f
=
DateField
(
input_formats
=
[
format
])
d
=
datetime
.
date
(
2007
,
9
,
17
)
self
.
assertFalse
(
f
.
has_changed
(
d
,
'17/09/2007'
))
# Test for deprecated behavior _has_changed
self
.
assertFalse
(
f
.
_has_changed
(
d
,
'17/09/2007'
))
def
test_datefield_strptime
(
self
):
"""Test that field.strptime doesn't raise an UnicodeEncodeError (#16123)"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment