# Path: mtr/sync/lib/manager.py
# class Manager(BaseManager):
#     def convert_value(self, value, field, export=False, action=None):
#     def processor_choices(self):
#     def dataset_choices(self):
#     def action_choices(self):
#     def converter_choices(self):
#     def make_processor(self, settings, from_extension=False):
#     def export_data(self, settings, data=None):
#     def export_data_inline(self, **settings):
#     def import_data_inline(self, **settings):
#     def filter_dataset(self, settings, dataset=None):
#     def prepare_export_dataset(self, settings):
#     def prepare_export_data(self, processor, queryset):
#     def prepare_handlers(self, key_name, processor, model, context=None):
#     def prepare_context(self, settings, path):
#     def prepare_import_data(self, processor, model):
#     def import_data(self, settings, path=None):
#     def prepare_import_dataset(self, settings, processor, model, fields):
#     def model_data(self, settings, processor, model, fields):
# 
# Path: mtr/sync/translation.py



from django.db import models
from .manager import manager
from ..translation import gettext_lazy as _
from mtr.utils.helpers import update_instance

    return filter_params, can_create


def filter_attrs(raw_attrs, fields, mfields, name=None):
    update_fields = [f.update for f in fields] or fields
    update_values = {}

    for field in update_fields:
        if ('_|' not in field.attribute and name is None) or \
                (name and name in field.attribute):
            update_values[field.attribute] = field.set_value or \
                raw_attrs[field.attribute]

    return update_values


def find_instances(model, model_attrs, params, fields):
    filter_params = params
    instances = model._default_manager.all()

    filter_params, can_create = filter_fields(
        model_attrs, fields, can_create=False, params=filter_params)

    if filter_params.keys():
        instances = instances.filter(**filter_params)

    return instances



# Path: mtr/sync/lib/manager.py
# class Manager(BaseManager):
#     def convert_value(self, value, field, export=False, action=None):
#     def processor_choices(self):
#     def dataset_choices(self):
#     def action_choices(self):
#     def converter_choices(self):
#     def make_processor(self, settings, from_extension=False):
#     def export_data(self, settings, data=None):
#     def export_data_inline(self, **settings):
#     def import_data_inline(self, **settings):
#     def filter_dataset(self, settings, dataset=None):
#     def prepare_export_dataset(self, settings):
#     def prepare_export_data(self, processor, queryset):
#     def prepare_handlers(self, key_name, processor, model, context=None):
#     def prepare_context(self, settings, path):
#     def prepare_import_data(self, processor, model):
#     def import_data(self, settings, path=None):
#     def prepare_import_dataset(self, settings, processor, model, fields):
#     def model_data(self, settings, processor, model, fields):
# 
# Path: mtr/sync/translation.py



# Path: mtr/sync/lib/actions.py
from django.db import models
from .manager import manager
from ..translation import gettext_lazy as _
from mtr.utils.helpers import update_instance


    return filter_params, can_create


def filter_attrs(raw_attrs, fields, mfields, name=None):
    update_fields = [f.update for f in fields] or fields
    update_values = {}

    for field in update_fields:
        if ('_|' not in field.attribute and name is None) or \
                (name and name in field.attribute):
            update_values[field.attribute] = field.set_value or \
                raw_attrs[field.attribute]

    return update_values


def find_instances(model, model_attrs, params, fields):
    filter_params = params
    instances = model._default_manager.all()

    filter_params, can_create = filter_fields(
        model_attrs, fields, can_create=False, params=filter_params)

    if filter_params.keys():
        instances = instances.filter(**filter_params)

    return instances



@manager.register('action', _('Create only'), use_transaction=True)