[pyar] [Consulta] Django
Apokalyptica Painkiller
apokalyptica79 en gmail.com
Mar Mayo 8 19:48:02 ART 2012
Otra vez yo gente, siguiendo con el tuto 2
https://docs.djangoproject.com/en/dev/intro/tutorial02/, en la parte que
dice *Customize the admin change list* me dice lo siguiente:
Edit your admin.py file again and add an improvement to the Poll change
> list page: Filters. Add the following line to PollAdmin:
>
> list_filter = ['pub_date']
>
> Lo añado a mi admin.py:
class PollAdmin(admin.ModelAdmin):
fields = ['pub_date', 'question']
list_display = ('question', 'pub_date', 'was_published_recently')
*list_filter = ['pub_date'] *
Pero cuando lo ejecuto no veo el cambio como me dice el ejemplo:
That adds a "Filter" sidebar that lets people filter the change list by the
> pub_date field:
La columna nueva de filter que debería de aparecer yo no la veo y lo mismo
me pasa cuando añado esto al admin.py:
search_fields = ['question']
Tampoco veo la caja del search.
Mi admin.py completo es:
from polls.models import Poll, Choice
from django.contrib import admin
> class PollAdmin(admin.ModelAdmin):
fields = ['pub_date', 'question']
list_display = ('question', 'pub_date', 'was_published_recently')
list_filter = ['pub_date']
search_fields = ['question']
> class ChoiceInline(admin.TabularInline):
model = Choice
extra = 3
> class PollAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question']}),
('Date information', {'fields': ['pub_date'], 'classes':
> ['collapse']}),
]
inlines = [ChoiceInline]
admin.site.register(Poll, PollAdmin)
> admin.site.register(Choice)
Gracias, saludos
--
I live each day
Like it's my last
I live for rock and roll
I never look back
I'm a rocker
Do as I feel as I say
I'm a rocker
And no one can take that away
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20120508/6ac4f3a4/attachment.html>
More information about the pyar
mailing list