Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (19 sloc) 0.688 kB
from django.forms import ModelForm
from django.utils.safestring import SafeText
from .models import (
MenuPluginSettings,
)
class EmbedPagesAdminForm(ModelForm):
class Meta:
model = MenuPluginSettings
def __init__(self, *args, **kwargs):
super(EmbedPagesAdminForm, self).__init__(*args, **kwargs)
choices = [self.fields['root'].choices.__iter__().next()]
for page in self.fields['root'].queryset:
choices.append(
(
page.id,
SafeText(''.join([u"   "*page.level, page.__unicode__()]))
)
)
self.fields['root'].choices = choices
Jump to Line
Something went wrong with that request. Please try again.