(
    organization_id, backend=None, queryset=None, model=None
)
return queryset
Adds organization filtering to default template queryset:
        filter only templates belonging to same organization
        or shared templates (with organization=None)
    This function is used in:
        * openwisp_controller.config.Template.get_default_templates
        * openwisp_controller.config.views.get_default_templates
Adds organization filtering to default template queryset:
        filter only templates belonging to same organization
        or shared templates (with organization=None)
    This function is used in:
        * openwisp_controller.config.Template.get_default_templates
        * openwisp_controller.config.views.get_default_templates
Adds organization filtering to default template queryset : filter only templates belonging to same organization or shared templates ( with organization = None ) This function is used in : * openwisp_controller . config . Template . get_default_templates * openwisp_controller . config . views . get_default_templates
def get_default_templates_queryset(
    organization_id, backend=None, queryset=None, model=None
):
    """
    Adds organization filtering to default template queryset:
        filter only templates belonging to same organization
        or shared templates (with organization=None)
    This function is used in:
        * openwisp_controller.config.Template.get_default_templates
        * openwisp_controller.config.views.get_default_templates
    """
    if queryset is None:
        queryset = model.objects.filter(default=True)
    if organization_id:
        queryset = queryset.filter(
            Q(organization_id=organization_id) | Q(organization_id=None)
        ).order_by('-required', 'name')
    if backend:
        queryset = queryset.filter(backend=backend)
    return queryset
def get_default_templates_queryset ( organization_id , backend = None , queryset = None , model = None ) : if queryset is None : queryset = model . objects . filter ( default = True ) if organization_id : queryset = queryset . filter ( Q ( organization_id = organization_id ) | Q ( organization_id = None ) ) . order_by ( '-required' , 'name' ) if backend : queryset = queryset . filter ( backend = backend ) return queryset