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
6e55cf0d
Kaydet (Commit)
6e55cf0d
authored
Tem 06, 2018
tarafından
Harry Moreno
Kaydeden (comit)
Tim Graham
Tem 07, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed usage of 'object' variable name in docs.
üst
66b6b689
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
generic-display.txt
docs/topics/class-based-views/generic-display.txt
+4
-6
shortcuts.txt
docs/topics/http/shortcuts.txt
+6
-6
No files found.
docs/topics/class-based-views/generic-display.txt
Dosyayı görüntüle @
6e55cf0d
...
...
@@ -418,13 +418,11 @@ object -- so we simply override it and wrap the call::
queryset = Author.objects.all()
def get_object(self):
# Call the superclass
object = super().get_object()
obj = super().get_object()
# Record the last accessed date
object.last_accessed = timezone.now()
object.save()
# Return the object
return object
obj.last_accessed = timezone.now()
obj.save()
return obj
.. note::
...
...
docs/topics/http/shortcuts.txt
Dosyayı görüntüle @
6e55cf0d
...
...
@@ -127,8 +127,8 @@ You can use the :func:`redirect` function in a number of ways.
def my_view(request):
...
obj
ect
= MyModel.objects.get(...)
return redirect(obj
ect
)
obj = MyModel.objects.get(...)
return redirect(obj)
2. By passing the name of a view and optionally some positional or
keyword arguments; the URL will be reverse resolved using the
...
...
@@ -156,8 +156,8 @@ will be returned::
def my_view(request):
...
obj
ect
= MyModel.objects.get(...)
return redirect(obj
ect
, permanent=True)
obj = MyModel.objects.get(...)
return redirect(obj, permanent=True)
``get_object_or_404()``
=======================
...
...
@@ -190,7 +190,7 @@ The following example gets the object with the primary key of 1 from
from django.shortcuts import get_object_or_404
def my_view(request):
my_object
= get_object_or_404(MyModel, pk=1)
obj
= get_object_or_404(MyModel, pk=1)
This example is equivalent to::
...
...
@@ -198,7 +198,7 @@ This example is equivalent to::
def my_view(request):
try:
my_object
= MyModel.objects.get(pk=1)
obj
= MyModel.objects.get(pk=1)
except MyModel.DoesNotExist:
raise Http404("No MyModel matches the given query.")
...
...
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