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
7b2d95eb
Kaydet (Commit)
7b2d95eb
authored
Kas 22, 2012
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Clarified usage of as_view kwargs for setting arguments on class based views
Thanks Dave McLain for the patch.
üst
3587991b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
base.py
django/views/generic/base.py
+3
-2
index.txt
docs/ref/class-based-views/index.txt
+3
-2
No files found.
django/views/generic/base.py
Dosyayı görüntüle @
7b2d95eb
...
...
@@ -54,8 +54,9 @@ class View(object):
"keyword argument to
%
s(). Don't do that."
%
(
key
,
cls
.
__name__
))
if
not
hasattr
(
cls
,
key
):
raise
TypeError
(
"
%
s() received an invalid keyword
%
r"
%
(
cls
.
__name__
,
key
))
raise
TypeError
(
"
%
s() received an invalid keyword
%
r. as_view "
"only accepts arguments that are already "
"attributes of the class."
%
(
cls
.
__name__
,
key
))
def
view
(
request
,
*
args
,
**
kwargs
):
self
=
cls
(
**
initkwargs
)
...
...
docs/ref/class-based-views/index.txt
Dosyayı görüntüle @
7b2d95eb
...
...
@@ -37,10 +37,11 @@ A class-based view is deployed into a URL pattern using the
is modified, the actions of one user visiting your view could have an
effect on subsequent users visiting the same view.
A
ny argument
passed into :meth:`~django.views.generic.base.View.as_view()` will
A
rguments
passed into :meth:`~django.views.generic.base.View.as_view()` will
be assigned onto the instance that is used to service a request. Using the
previous example, this means that every request on ``MyView`` is able to use
``self.size``.
``self.size``. Arguments must correspond to attributes that already exist on
the class (return ``True`` on a ``hasattr`` check).
Base vs Generic views
---------------------
...
...
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