'Method for get relationship
:param args:
:param kwargs:
:return:'

def before_get(self, args, kwargs):

    discount = db.session.query(DiscountCode).filter_by(id=kwargs.get('id')).one()
    if (not discount):
        raise ObjectNotFound({'parameter': '{id}'}, 'DiscountCode:        not    found')
    if ((discount.used_for == 'ticket') and has_access('is_coorganizer', event_id=discount.event_id)):
        self.schema = DiscountCodeSchemaTicket
    elif ((discount.used_for == 'event') and has_access('is_admin')):
        self.schema = DiscountCodeSchemaEvent
    else:
        raise UnprocessableEntity({'source': ''}, 'Please    check    used_for    and    endpoint    and    verify    your    permission')
