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
d6e26e5b
Kaydet (Commit)
d6e26e5b
authored
Şub 28, 2017
tarafından
Tim Graham
Kaydeden (comit)
GitHub
Şub 28, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed obsolete references to form_for_instance().
üst
5f3a689f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
17 deletions
+0
-17
files.py
django/db/models/fields/files.py
+0
-7
models.py
tests/model_forms/models.py
+0
-8
tests.py
tests/model_forms/tests.py
+0
-2
No files found.
django/db/models/fields/files.py
Dosyayı görüntüle @
d6e26e5b
...
...
@@ -322,13 +322,6 @@ class FileField(Field):
def
formfield
(
self
,
**
kwargs
):
defaults
=
{
'form_class'
:
forms
.
FileField
,
'max_length'
:
self
.
max_length
}
# If a file has been provided previously, then the form doesn't require
# that a new file is provided this time.
# The code to mark the form field as not required is used by
# form_for_instance, but can probably be removed once form_for_instance
# is gone. ModelForm uses a different method to check for an existing file.
if
'initial'
in
kwargs
:
defaults
[
'required'
]
=
False
defaults
.
update
(
kwargs
)
return
super
()
.
formfield
(
**
defaults
)
...
...
tests/model_forms/models.py
Dosyayı görüntüle @
d6e26e5b
"""
XX. Generating HTML forms from models
This is mostly just a reworking of the ``form_for_model``/``form_for_instance``
tests to use ``ModelForm``. As such, the text may not make sense in all cases,
and the examples are probably a poor fit for the ``ModelForm`` syntax. In other
words, most of these tests should be rewritten.
"""
import
datetime
import
os
import
tempfile
...
...
tests/model_forms/tests.py
Dosyayı görüntüle @
d6e26e5b
...
...
@@ -1363,8 +1363,6 @@ class ModelFormBasicTests(TestCase):
'''<tr><th>Headline:</th><td><input type="text" name="headline" maxlength="50" required /></td></tr>
<tr><th>Pub date:</th><td><input type="text" name="pub_date" required /></td></tr>'''
)
# You can create a form over a subset of the available fields
# by specifying a 'fields' argument to form_for_instance.
class
PartialArticleFormWithSlug
(
forms
.
ModelForm
):
class
Meta
:
model
=
Article
...
...
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