Martin Tiršel
unread,Feb 23, 2013, 5:13:31 AM2/23/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ella-p...@googlegroups.com
Zdravim,
potreboval som prepisat title/description v RSS feede, tak som sa pustil
do pouzitia app_data, ale dostal som sa k problemu, s ktorym neviem co
robit, kedze este velmi ellu nepoznam. Najpr popisem co som spravil:
1. vytvoril appku blog
2. blog/__init__.py (pripadne je "vhodnejsie" miesto, kde registrovat
app_data rozsirenia?):
class FeedOverrideAppDataForm(AppDataForm):
title = forms.CharField(
label=_("Title"),
max_length=200,
required=False,
help_text=_('Override category title for syndication'),
)
description = forms.CharField(
label=_("Description"),
required=False,
help_text=_('Override category description for syndication'),
)
app_registry.register(
'syndication',
AppDataContainer.from_form(FeedOverrideAppDataForm),
Category
)
3. blog/admin.py:
from django.contrib import admin
from ella.core.admin import CategoryAdmin
from ella.core.models.main import Category
class BlackpageCategoryAdmin(CategoryAdmin):
declared_fieldsets = (
(
None, {
'fields': (
'title',
'slug', (
'description',
'content'
),
'template', (
'site',
'tree_parent'
),
'ella.paginate_by',
# 'ella.first_page_count',
'ella.propagate_listings'
)
}
),
(
'Syndication', {
'fields': (
'syndication.title',
'syndication.description',
)
}
),
)
admin.site.unregister(Category)
admin.site.register(Category, BlackpageCategoryAdmin)
Cize zobral som CategoryAdmin z elly, skopiroval declared_fieldsets a
pridal moju cast. Lenze problem je u ella.first_page_count, ak to tam
necham, dostavam nasledovnu chybu:
"Field 'first_page_count' not found in Form {'paginate_by':
<django.forms.fields.IntegerField object at 0x7f83105e5990>,
'propagate_listings': <django.forms.fields.BooleanField object at
0x7f83105e5a10>}"
Zaujimave, ze ak declared_fieldsets neprepisem, tak danu chybu nedostanem
a editacia kategorie sa zobrazi korektne (samozrejme okrem mojej
syndication casti). Preco je tomu tak? Problematicke pole v adminovi nie
je, zobrazuje sa ella.paginate_by a ella.propagate_listings, ale nie
ella.first_page_count. Co vlastne toto pole je a co ma robit? Nie je to
treba len nieco pozabudnute, co tam uz nema byt?
Pripadne robim nieco zle na registracii vlastnych poli pre modely? V ella
dokumentacii je to sice popisane inak, ale v tomto je dokumentacia asi
zastarala a od tej doby sa to menilo (opravim).
--
S pozdravom/Regards,
Martin Tiršel