@staticmethod
    def from_reminder(reminder):
        data = {
            'type': reminder.type.key,
            'notifications': []
        }

        if reminder.valid_until:
            for part in ['month', 'day', 'year']:
                data['valid_until/%s' % part] = getattr(reminder.valid_until, part, None)

        if reminder.type == 'BAL':
            data['balance_threshold'] = round(reminder.threshold, 2) % '%.2f'
        elif reminder.type == 'RIDE':
            data['ride_threshold'] = reminder.threshold
        elif reminder.type == 'ROUND_TRIP':
            data['round_trip_threshold'] = reminder.threshold
        elif reminder.type == 'EXP':
            data['exp_threshold'] = reminder.threshold
            data['exp_quantity'] = reminder.quantifier

        if reminder.send_sms:
            data['notifications'].append('SMS')
        if reminder.send_email:
            data['notifications'].append('EMAIL')

        # Remove any None values
        for key in data.copy():
            if data[key] is None:
                del data[key]

        return ReminderForm(MultiDict(data))
dataset/ETHPy150Open shaunduncan/breezeminder/breezeminder/forms/reminder.py/ReminderForm.from_reminder/swapped operands of `%`