'Get the cycle start date'

def get_cycle_start(self):

    if (not self.cycle_end):
        return None
    cycle_end = self.cycle_end
    if (self.cycle_period == 'monthly'):
        p = relativedelta(months=(+ 1))
    elif (self.cycle_period == 'weekly'):
        p = timedelta(weeks=1)
    elif (self.cycle_period == 'daily'):
        p = timedelta(days=1)
    elif (self.cycle_period == 'quarterly'):
        p = relativedelta(months=(+ 4))
    elif (self.cycle_period == 'yearly'):
        p = relativedelta(years=1)
    else:
        p = relativedelta(months=(+ 1))
    cycle_start = (cycle_end - p)
    return cycle_start
