def extract_plugin_pks(input_post_data, plugins_queryset = False):
    """
    Reduces form POST data to list of submitted plugin's PK's.
    
    Returns list of POST form plugin's PK's.
    Takes:
    - serialized form POST data
    - Plugin model queryset, or produces own if not provided.
    """
    if not plugins_queryset: plugins_queryset = Plugin.objects.all()
    clean_plugintypes = get_all_plugintypes(plugins_queryset)
    requested_plugin_pks = []
    # clean form POST and list all plugin's PK's
    for form_field_name in input_post_data:
        if form_field_name in clean_plugintypes:
            #field is Plugin's type field
            requested_plugin_pks.extend(input_post_data.getlist(form_field_name))
    return requested_plugin_pks
dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/apps/dms_plugins/representator.py/extract_plugin_pks/original