示例#1
0
 def __init__(self, **kwargs):
     super(ScriptForm, self).__init__(**kwargs)
     event_choices = get_name_map("notify_event")
     self.fields["event_identifier"].choices = event_choices
     self.fields["event_identifier"].widget.choices = event_choices
     if self.instance.pk:
         self.fields["event_identifier"].help_text = (_(
             u"Warning: Changing the event for an existing script may have unexpected effects."
         ))
示例#2
0
文件: forms.py 项目: gurch101/shuup
 def __init__(self, **kwargs):
     super(ScriptForm, self).__init__(**kwargs)
     event_choices = get_name_map("notify_event")
     self.fields["event_identifier"].choices = event_choices
     self.fields["event_identifier"].widget.choices = event_choices
     if self.instance.pk:
         self.fields["event_identifier"].help_text = (
             _(u"Warning: Changing the event for an existing script may have unexpected effects.")
         )
示例#3
0
文件: list.py 项目: zarlant/shuup
 def get_event_identifier_text(self, instance):
     if not hasattr(self, "_event_identifier_names"):
         self._event_identifier_names = dict(get_name_map("notify_event"))
     return self._event_identifier_names.get(instance.event_identifier,
                                             instance.event_identifier)
示例#4
0
文件: list.py 项目: ruqaiya/shuup
 def get_event_identifier_text(self, instance):
     if not hasattr(self, "_event_identifier_names"):
         self._event_identifier_names = dict(get_name_map("notify_event"))
     return self._event_identifier_names.get(instance.event_identifier, instance.event_identifier)