cms.core.translations.management.commands package

Submodules

cms.core.translations.management.commands.cms_core_translations_sync module

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.

class cms.core.translations.management.commands.cms_core_translations_sync.Command

Bases: cms.core.management.base.BaseCommand

confirm(sql_sentences, model_full_name)
get_changed_size(model, field_name, db_table)

Gets only missings fields.

get_missing_languages(field_name, db_table)

Gets only missings fields.

get_sync_sql(field_name, missing_langs, model)

Returns SQL needed for sync schema for a new translatable field.

get_sync_sql_size(field_name, changed_sizes, model)

Returns SQL needed for sync schema for a new translatable field.

get_table_fields(db_table)

Gets table fields from schema.

get_table_fields_size(db_table, field_name)

Gets table fields from schema.

handle(*args, **options)
help = 'Detect new translatable fields or new available languages and sync database structure. Does not remove columns of removed languages or undeclared fields.'
log_changed_sizes(missing_langs, field_name, model_name)
log_missing_langs(missing_langs, field_name, model_name)
option_list = (<Option at 0x2509a70: -v/--verbosity>, <Option at 0x2509b90: --settings>, <Option at 0x2509c20: --pythonpath>, <Option at 0x2509cf8: --traceback>, <Option at 0x2509dd0: --no-color>, <Option at 0xd8af368: -a/--app>, <Option at 0xd8af1b8: -y/--yes>, <Option at 0xde5ee60: --all>, <Option at 0xde5e290: --commit>, <Option at 0xde5e200: --database>)
set_options(**options)

Set instance variables based on an options dict

Module contents