コード例 #1
0
    def save(self):
        if not self.is_valid():
            raise Exception('The form must be valid in order to save')
        start_ts = self.cleaned_data['start_ts']
        end_ts = self.cleaned_data['end_ts']
        message = self.cleaned_data['message']
        delay_ms = self.cleaned_data['delay_ms']

        motd = MOTD(start_ts=start_ts, end_ts=end_ts, message=message, delay_ms=delay_ms)
        motd.save()

        return motd
コード例 #2
0
ファイル: forms.py プロジェクト: nadineproject/nadine
    def save(self):
        if not self.is_valid():
            raise Exception('The form must be valid in order to save')
        start_ts = self.cleaned_data['start_ts']
        end_ts = self.cleaned_data['end_ts']
        message = self.cleaned_data['message']
        delay_ms = self.cleaned_data['delay_ms']

        motd = MOTD(start_ts=start_ts, end_ts=end_ts, message=message, delay_ms=delay_ms)
        motd.save()

        return motd