def __init__(self, to, chained_field=None, chained_model_field=None,
                 auto_choose=False, **kwargs):
        try:
            isbasestring = isinstance(to, basestring)
        except NameError:
            isbasestring = isinstance(to, str)
        if isbasestring:
            self.to_app_name, self.to_model_name = to.split('.')
        else:
            self.to_app_name = to._meta.app_label
            self.to_model_name = to._meta.object_name
        self.chain_field = chained_field
        self.chained_model_field = chained_model_field
        self.auto_choose = auto_choose
        ManyToManyField.__init__(self, to, **kwargs)
examples:
dataset/ETHPy150Open digi604/django-smart-selects/smart_selects/db_fields.py/ChainedManyToManyField.__init__