add ChoiceField for template name
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
from ckeditor_uploader.widgets import CKEditorUploadingWidget
|
||||
from django import forms
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from .models import CustomFlatPage
|
||||
|
||||
|
||||
class FlatPageForm(forms.ModelForm):
|
||||
__choices = [
|
||||
("flatpages/default.html", _("default.html")),
|
||||
("flatpages/social_media.html", _("social_media.html")),
|
||||
]
|
||||
template_name = forms.ChoiceField(choices=__choices)
|
||||
|
||||
class Meta:
|
||||
model = CustomFlatPage
|
||||
fields = '__all__'
|
||||
|
||||
Reference in New Issue
Block a user