':return: Return all order objects with the current user'

@staticmethod
def get_orders_of_user(user_id=None, upcoming_events=True):

    if (not user_id):
        user_id = login.current_user.id
    query = Order.query.join(Order.event).filter((Order.user_id == user_id)).filter(or_((Order.status == 'completed'), (Order.status == 'placed')))
    if upcoming_events:
        return query.filter((Event.starts_at >= datetime.now()))
    else:
        return query.filter((Event.ends_at < datetime.now()))
