Пример #1
0
    def __init__(self, *args, **kwargs):
        super(QuestDependenciesForm, self).__init__(*args, **kwargs)

        objects = CM.QUESTS.all_with_base()
        choices = [(obj["key"], obj["name"] + " (" + obj["key"] + ")") for obj in objects]
        self.fields['quest'] = forms.ChoiceField(choices=choices)
        self.fields['dependency'] = forms.ChoiceField(choices=choices)
        
        objects = QUEST_STATUS_SET.all()
        choices = [(obj, obj) for obj in objects]
        self.fields['type'] = forms.ChoiceField(choices=choices)

        localize_form_fields(self)
Пример #2
0
    def __init__(self, *args, **kwargs):
        super(DialogueQuestDependenciesForm, self).__init__(*args, **kwargs)

        objects = CM.DIALOGUES.objects.all()
        choices = [(obj.key, obj.name + " (" + obj.key + ")")
                   for obj in objects]
        self.fields['dialogue'] = forms.ChoiceField(choices=choices)

        objects = CM.QUESTS.all_base()
        choices = [(obj["key"], obj["name"] + " (" + obj["key"] + ")")
                   for obj in objects]
        self.fields['dependency'] = forms.ChoiceField(choices=choices)

        objects = QUEST_STATUS_SET.all()
        choices = [obj for obj in objects]
        self.fields['type'] = forms.ChoiceField(choices=choices)

        localize_form_fields(self)