@@ -0,0 +1,1997 @@
+from ckan.plugins import toolkit%0Afrom ckan.logic import check_access%0Aimport ckan.lib.navl.dictization_functions as df%0A%0Afrom ckanext.requestdata.logic import schema%0Afrom ckanext.requestdata.model import ckanextRequestdata%0A%0A%0Adef request_create(context, data_dict):%0A    '''Create new request data.%0A%0A    :param sender_name: The name of the sender who request data.%0A    :type sender_name: string%0A%0A    :param organization: The sender's organization.%0A    :type organization: string%0A%0A    :param email_address: The sender's email_address.%0A    :type email_address: string%0A%0A    :param message_content: The content of the message.%0A    :type message_content: string%0A%0A    :param package_name: The name of the package the data belongs to.%0A    :type package_name: string%0A%0A    :param data_shared: Whether data is shared or not.%0A    :type data_shared: boolean%0A%0A    :returns: the newly created request data%0A    :rtype: dictionary%0A%0A    '''%0A%0A    check_access('requestdata_request_create', context, data_dict)%0A%0A    data, errors = df.validate(data_dict, schema.request_create_schema(),%0A                               context)%0A%0A    if errors:%0A        raise toolkit.ValidationError(errors)%0A%0A    sender_name = data.get('sender_name')%0A    organization = data.get('organization')%0A    email_address = data.get('email_address')%0A    message_content = data.get('message_content')%0A    package_name = data.get('package_name')%0A    data_shared = data.get('data_shared')%0A%0A    data = %7B%0A        'sender_name': sender_name,%0A        'organization': organization,%0A        'email_address': email_address,%0A        'message_content': message_content,%0A        'package_name': package_name,%0A        'data_shared': data_shared%0A    %7D%0A%0A    requestdata = ckanextRequestdata(**data)%0A    requestdata.save()%0A%0A    out = requestdata.as_dict()%0A%0A    return out%0A%0A%0Adef request_show(context, data_dict):%0A    pass%0A%0A%0Adef request_list(self):%0A    pass%0A%0A%0Adef request_patch(self):%0A    pass%0A%0A%0Adef request_update(self):%0A    pass%0A%0A%0Adef request_delete(self):%0A    pass%0A

Add action for creating new request data