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
b649f686
Kaydet (Commit)
b649f686
authored
Agu 28, 2015
tarafından
Y3K
Kaydeden (comit)
Tim Graham
Agu 29, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #25262 -- Removed the enable_comments field from FlatPageAdmin.
üst
e7588233
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
4 deletions
+44
-4
admin.py
django/contrib/flatpages/admin.py
+5
-3
index.txt
docs/ref/contrib/admin/index.txt
+1
-1
flatpages.txt
docs/ref/contrib/flatpages.txt
+34
-0
1.9.txt
docs/releases/1.9.txt
+4
-0
No files found.
django/contrib/flatpages/admin.py
Dosyayı görüntüle @
b649f686
...
...
@@ -8,11 +8,13 @@ class FlatPageAdmin(admin.ModelAdmin):
form
=
FlatpageForm
fieldsets
=
(
(
None
,
{
'fields'
:
(
'url'
,
'title'
,
'content'
,
'sites'
)}),
(
_
(
'Advanced options'
),
{
'classes'
:
(
'collapse'
,),
'fields'
:
(
'enable_comments'
,
'registration_required'
,
'template_name'
)}),
(
_
(
'Advanced options'
),
{
'classes'
:
(
'collapse'
,),
'fields'
:
(
'registration_required'
,
'template_name'
),
}),
)
list_display
=
(
'url'
,
'title'
)
list_filter
=
(
'sites'
,
'
enable_comments'
,
'
registration_required'
)
list_filter
=
(
'sites'
,
'registration_required'
)
search_fields
=
(
'url'
,
'title'
)
admin
.
site
.
register
(
FlatPage
,
FlatPageAdmin
)
docs/ref/contrib/admin/index.txt
Dosyayı görüntüle @
b649f686
...
...
@@ -330,7 +330,7 @@ subclass::
}),
('Advanced options', {
'classes': ('collapse',),
'fields': ('
enable_comments', 'registration_required', 'template_name')
'fields': ('
registration_required', 'template_name'),
}),
)
...
...
docs/ref/contrib/flatpages.txt
Dosyayı görüntüle @
b649f686
...
...
@@ -170,6 +170,8 @@ For more on middleware, read the :doc:`middleware docs
How to add, change and delete flatpages
=======================================
.. _flatpages-admin:
Via the admin interface
-----------------------
...
...
@@ -177,6 +179,38 @@ If you've activated the automatic Django admin interface, you should see a
"Flatpages" section on the admin index page. Edit flatpages as you edit any
other object in the system.
The ``FlatPage`` model has an ``enable_comments`` field that isn't used by
``contrib.flatpages``, but that could be useful for your project or third-party
apps. It doesn't appear in the admin interface, but you can add it by
registering a custom ``ModelAdmin`` for ``FlatPage``::
from django.contrib import admin
from django.contrib.flatpages.admin import FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext_lazy as _
# Define a new FlatPageAdmin
class FlatPageAdmin(FlatPageAdmin):
fieldsets = (
(None, {'fields': ('url', 'title', 'content', 'sites')}),
(_('Advanced options'), {
'classes': ('collapse', ),
'fields': (
'enable_comments',
'registration_required',
'template_name',
),
}),
)
# Re-register FlatPageAdmin
admin.site.unregister(FlatPage)
admin.site.register(FlatPage, FlatPageAdmin)
.. versionchanged:: 1.9
The ``enable_comments`` field was removed from ``FlatPageAdmin``.
Via the Python API
------------------
...
...
docs/releases/1.9.txt
Dosyayı görüntüle @
b649f686
...
...
@@ -996,6 +996,10 @@ Miscellaneous
levels. Previously, messages of ``ERROR`` level or higher were printed to the
console.
* The ``FlatPage.enable_comments`` field is removed from the ``FlatPageAdmin``
as it's unused by the application. If your project or a third-party app makes
use of it, :ref:`create a custom ModelAdmin <flatpages-admin>` to add it back.
.. _deprecated-features-1.9:
Features deprecated in 1.9
...
...
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