Module Expr Str ImportFrom alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam defaults body Print BinOpMod Str NameLoad For NameStore NameLoad body Print BinOpMod Str NameLoad While NameLoad body Assign NameStore Str If NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr orelse Assign NameStore Str If CompareEq NameLoad Str body Return NameLoad orelse If CompareNotIn NameLoad TupleLoad Str Str Str Str body Print Str orelse If BoolOpOr CompareEq NameLoad Str CompareEq NameLoad Str body Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Print BinOpMod Str TupleLoad NameLoad NameLoad Call AttributeLoad Str attr NameLoad decorator_list ClassDef bases NameLoad body Assign NameStore Str Assign NameStore BinOpAdd AttributeLoad NameLoad attr TupleLoad Call NameLoad Str keyword Str keyword Str keyword NameLoad keyword Str FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad For NameStore NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If CompareLt AttributeLoad NameLoad attr TupleLoad Num Num body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore SubscriptLoad Call NameLoad NameLoad Index Num Assign NameStore IfExp AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body Assign NameStore NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad AttributeLoad NameLoad attr If NameLoad body Print Str For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Print Str orelse Print Str If CompareLt AttributeLoad NameLoad attr TupleLoad Num Num body Expr Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Print Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Return ListComp SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body If CompareNotIn Call NameLoad NameLoad NameLoad NameLoad body Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad Assign NameStore ListLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr For NameStore NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore ListLoad Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMod Str TupleLoad Call NameLoad NameLoad Call AttributeLoad Str attr NameLoad If UnaryOpNot AttributeLoad NameLoad attr body AugAssignAdd NameStore BinOpAdd Str Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str Return NameLoad decorator_list decorator_list
N/A N/A 
Detect new translatable fields in all models and sync database structure.

You will need to execute this command in two cases:

    1. When you add new languages to settings.LANGUAGES.
    2. When you add new translatable fields to your models.

Credits: Heavily inspired by django-transmeta's sync_transmeta_db command.
 optparse make_option N/A django django.core.management.base BaseCommand django.core.management.color no_style django.db connection transaction django.utils.six moves modeltranslation.settings AVAILABLE_LANGUAGES modeltranslation.translator translator modeltranslation.utils build_localized_fieldname ask_for_confirmation N/A N/A sql_sentences model_full_name interactive N/A N/A N/A N/A 
SQL to synchronize "%s" schema: model_full_name N/A sentence sql_sentences N/A N/A N/A    %s sentence N/A True N/A N/A prompt 
Are you sure that you want to execute the previous SQL: (y/n) [n]:  N/A interactive N/A N/A answer N/A N/A N/A N/A moves input prompt strip N/A N/A answer y N/A N/A answer N/A N/A False N/A N/A N/A answer N/A y n yes no N/A N/A Please answer yes or no N/A N/A N/A N/A answer y N/A answer yes N/A N/A True N/A N/A False N/A print_missing_langs N/A N/A missing_langs field_name model_name N/A N/A N/A N/A Missing languages in "%s" field from "%s" model: %s N/A field_name model_name N/A N/A ,  join missing_langs N/A Command N/A BaseCommand N/A N/A help Detect new translatable fields or new available languages and sync database structure. Does not remove columns of removed languages or undeclared fields. N/A option_list N/A N/A BaseCommand option_list N/A N/A make_option --noinput action store_false dest interactive default True help Do NOT prompt the user for input of any kind. handle N/A N/A self N/A args options N/A N/A 
        Command execution.
         N/A N/A self cursor N/A N/A connection cursor N/A N/A self introspection N/A connection introspection N/A N/A self interactive N/A options N/A interactive N/A found_missing_fields False N/A models N/A N/A translator get_registered_models abstract False N/A model models N/A N/A db_table N/A N/A model _meta db_table N/A N/A N/A django VERSION N/A 1 8 N/A N/A model_name N/A N/A model _meta module_name N/A N/A model_name N/A N/A model _meta model_name N/A model_full_name N/A %s.%s N/A N/A N/A model _meta app_label model_name N/A opts N/A N/A translator get_options_for_model model N/A N/A field_name fields N/A N/A N/A opts local_fields items N/A N/A field N/A N/A list fields N/A 0 N/A column_name N/A N/A field db_column N/A field db_column field_name N/A missing_langs N/A list N/A N/A self get_missing_languages column_name db_table N/A missing_langs N/A N/A found_missing_fields True N/A N/A print_missing_langs missing_langs field_name model_full_name N/A sql_sentences N/A N/A self get_sync_sql field_name missing_langs model N/A execute_sql N/A ask_for_confirmation sql_sentences model_full_name N/A self interactive N/A execute_sql N/A N/A Executing SQL... N/A sentence sql_sentences N/A N/A N/A N/A N/A self cursor execute sentence N/A Done N/A N/A SQL not executed N/A N/A N/A django VERSION N/A 1 6 N/A N/A N/A N/A transaction commit_unless_managed N/A N/A found_missing_fields N/A N/A No new translatable fields detected N/A get_table_fields N/A N/A self db_table N/A N/A N/A 
        Gets table fields from schema.
         N/A db_table_desc N/A N/A N/A self introspection get_table_description N/A self cursor db_table N/A N/A N/A t N/A 0 N/A t db_table_desc N/A get_missing_languages N/A N/A self field_name db_table N/A N/A N/A 
        Gets only missings fields.
         N/A db_table_fields N/A N/A self get_table_fields db_table N/A lang_code AVAILABLE_LANGUAGES N/A N/A N/A N/A build_localized_fieldname field_name lang_code db_table_fields N/A N/A N/A lang_code N/A get_sync_sql N/A N/A self field_name missing_langs model N/A N/A N/A 
        Returns SQL needed for sync schema for a new translatable field.
         N/A qn N/A N/A connection ops quote_name N/A style N/A no_style N/A sql_output N/A N/A db_table N/A N/A model _meta db_table N/A lang missing_langs N/A N/A new_field N/A build_localized_fieldname field_name lang N/A f N/A N/A N/A model _meta get_field new_field N/A col_type N/A N/A f db_type connection connection N/A field_sql N/A N/A N/A style SQL_FIELD N/A qn N/A f column N/A N/A style SQL_COLTYPE col_type N/A stmt N/A ALTER TABLE %s ADD COLUMN %s N/A N/A qn db_table N/A N/A join field_sql N/A N/A N/A f null N/A N/A stmt N/A N/A N/A style SQL_KEYWORD NOT NULL N/A N/A N/A sql_output append N/A stmt ; N/A sql_output N/A N/A