Example #1
0
    def read(self, from_address=None, to_address=None, subject=None,
             payloads=None, verbose=False, **kwargs):
        lot = self.get_lot(to_address)
        if not lot:
            return False

        combined_payloads = '\r\n'.join(payloads)

        if verbose:
            print 'Starting with:'
            print '=============='
            print combined_payloads

        text = self.get_note_text(from_address, combined_payloads)

        # don't post empty notes!
        if not text:
            return False

        if verbose:
            print 'Ended up with:'
            print '=============='
            print text

        note = Note(
            lot=lot,
            noter=self.get_name(from_address),
            text=text,
        )
        note.save()
        return True
Example #2
0
    def save(self, commit=True):
        lot = self.cleaned_data['lot']

        note_text = self.cleaned_data['note']
        if note_text:
            note = Note(noter=self.cleaned_data['reviewer'].first_name, lot=lot, text=note_text)
            note.save()
        del self.cleaned_data['note']

        super(ReviewForm, self).save(commit=commit)
Example #3
0
    def save(self, commit=True):
        lot = self.cleaned_data['lot']

        note_text = self.cleaned_data['note']
        if note_text:
            note = Note(noter=self.cleaned_data['reviewer'].first_name,
                        lot=lot,
                        text=note_text)
            note.save()
        del self.cleaned_data['note']

        super(ReviewForm, self).save(commit=commit)