#NEWLINE# def __init__( self , to , chained_field = None , chained_model_field = None , show_all = False , auto_choose = False , view_name = None , **kwargs ) : #NEWLINE# #INDENT# '\n        examples:\n\n        class Continent(models.Model):\n            name = models.CharField(max_length=255)\n\n        class Country(models.Model):\n            continent = models.ForeignKey(Continent)\n\n        class Location(models.Model):\n            continent = models.ForeignKey(Continent)\n            country = ChainedForeignKey(\n                Country,\n                chained_field="continent",\n                chained_model_field="continent",\n                show_all=True,\n                auto_choose=True,\n                # limit_choices_to={\'name\':\'test\'}\n            )\n        ``chained_field`` is the name of the ForeignKey field referenced by ChainedForeignKey of the same Model.\n        in the examples, chained_field is the name of field continent in Model Location.\n\n        ``chained_model_field`` is the name of the ForeignKey field referenced in the \'to\' Model.\n        in the examples, chained_model_field is the name of field continent in Model Country.\n\n        ``show_all`` controls whether show other choices below the filtered choices, with separater \'----------\'.\n\n        ``auto_choose`` controls whether auto select the choice when there is only one available choice.\n\n        ``view_name`` controls which view to use, \'chained_filter\' or \'chained_filter_all\'.\n\n        ' #NEWLINE# if isinstance ( to , six . string_types ) : #NEWLINE# #INDENT# ( self . to_app_name , self . to_model_name ) = to . split ( '.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . to_app_name = to . _meta . app_label #NEWLINE# self . to_model_name = to . _meta . object_name #NEWLINE# #UNINDENT# self . chained_field = chained_field #NEWLINE# self . chained_model_field = chained_model_field #NEWLINE# self . show_all = to #NEWLINE# self . auto_choose = auto_choose #NEWLINE# self . view_name = view_name #NEWLINE# ForeignKey . __init__ ( self , to , ** kwargs )