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
b0d032f9
Kaydet (Commit)
b0d032f9
authored
Nis 30, 2014
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #22547 -- Added some links to tutorial 2.
Thanks bjb at sourcer.ca for the suggestion.
üst
e049c886
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
tutorial02.txt
docs/intro/tutorial02.txt
+16
-8
No files found.
docs/intro/tutorial02.txt
Dosyayı görüntüle @
b0d032f9
...
...
@@ -204,7 +204,8 @@ up into fieldsets:
admin.site.register(Question, QuestionAdmin)
The first element of each tuple in ``fieldsets`` is the title of the fieldset.
The first element of each tuple in
:attr:`~django.contrib.admin.ModelAdmin.fieldsets` is the title of the fieldset.
Here's what our form looks like now:
.. image:: _images/admin08t.png
...
...
@@ -350,8 +351,9 @@ Here's what it looks like at this point:
By default, Django displays the ``str()`` of each object. But sometimes it'd be
more helpful if we could display individual fields. To do that, use the
``list_display`` admin option, which is a tuple of field names to display, as
columns, on the change list page for the object:
:attr:`~django.contrib.admin.ModelAdmin.list_display` admin option, which is a
tuple of field names to display, as columns, on the change list page for the
object:
.. snippet::
:filename: polls/admin.py
...
...
@@ -396,8 +398,10 @@ attributes, as follows:
was_published_recently.boolean = True
was_published_recently.short_description = 'Published recently?'
Edit your :file:`polls/admin.py` file again and add an improvement to the Question
change list page: Filters. Add the following line to ``QuestionAdmin``::
Edit your :file:`polls/admin.py` file again and add an improvement to the
``Question`` change list page: filters using the
:attr:`~django.contrib.admin.ModelAdmin.list_filter`. Add the following line to
``QuestionAdmin``::
list_filter = ['pub_date']
...
...
@@ -423,9 +427,13 @@ scenes, limiting the number of search fields to a reasonable number will make
it easier for your database to do the search.
Now's also a good time to note that change lists give you free pagination. The
default is to display 100 items per page. Change-list pagination, search boxes,
filters, date-hierarchies and column-header-ordering all work together like you
think they should.
default is to display 100 items per page. :attr:`Change list pagination
<django.contrib.admin.ModelAdmin.list_per_page>`, :attr:`search boxes
<django.contrib.admin.ModelAdmin.search_fields>`, :attr:`filters
<django.contrib.admin.ModelAdmin.list_filter>`, :attr:`date-hierarchies
<django.contrib.admin.ModelAdmin.date_hierarchy>`, and
:attr:`column-header-ordering <django.contrib.admin.ModelAdmin.list_display>`
all work together like you think they should.
Customize the admin look and feel
=================================
...
...
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