私はfeincmsを初めて使用し、拡張機能を作成しようとしています。非常に基本的なものを作成しました
from __future__ import absolute_import, unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from feincms import extensions
class Extension(extensions.Extension):
def handle_model(self):
self.model.add_to_class('excerpt', models.TextField(
_('excerpt'),
blank=True,
help_text=_('Excerpts are good!')))
def handle_modeladmin(self, modeladmin):
modeladmin.add_extension_options(_('Exceprt'), {
'fields': ('excerpt',),
'classes': ('collapse',),
})
テキスト フィールドの抜粋を追加しますが、もう少し複雑なものを書きたいと思います。地域のメディアを選択するのと同様のプロセスを使用して、単一の注目の画像をページに追加できるようにしたいのですが、これを行う方法がわかりません。この拡張機能に関するガイダンスをいただければ幸いです。
ありがとう!