(cls, case, xform, client_date, action_types=None)
return transaction
Get or create a form transaction for a the given form and case.
Get or create a form transaction for a the given form and case.
Get or create a form transaction for a the given form and case .
def form_transaction(cls, case, xform, client_date, action_types=None):
        """Get or create a form transaction for a the given form and case.
        """
        action_types = action_types or []

        if any([not cls._valid_action_type(action_type) for action_type in action_types]):
            raise UnknownActionType('Unknown action type found')

        type_ = cls.TYPE_FORM

        for action_type in action_types:
            type_ |= action_type

        transaction = cls._from_form(case, xform, transaction_type=type_)
        transaction.client_date = client_date

        return transaction
def form_transaction ( cls , case , xform , client_date , action_types = None ) : action_types = action_types or [ ] if any ( [ not cls . _valid_action_type ( action_type ) for action_type in action_types ] ) : raise UnknownActionType ( 'Unknown action type found' ) type_ = cls . TYPE_FORM for action_type in action_types : type_ |= action_type transaction = cls . _from_form ( case , xform , transaction_type = type_ ) transaction . client_date = client_date return transaction