Commands

Drop Expired User Accounts

class integreat_cms.core.management.commands.drop_expired_user_accounts.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: LogCommand

Management command to delete users who were not activated within 7 days of creation

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser)[source]

Entry point for subclassed commands to add custom arguments.

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

create_parser(prog_name, subcommand, **kwargs)[source]

Create and return the ArgumentParser which will be used to parse the arguments to this command.

execute(*args, **options)[source]

Try to execute this command, performing system checks if needed (as controlled by the requires_system_checks attribute, except if force-skipped).

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

Parameters:
  • args (Any)

  • options (Any)

Return type:

None

help: str = 'Deletes users who were not activated within 7 days of their account creation.'[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

Print the help message for this command, derived from self.usage().

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
run_from_argv(argv)[source]

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]

Duplicate Pages

class integreat_cms.core.management.commands.duplicate_pages.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: DebugCommand

Management command to duplicate all pages of a region

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser: CommandParser) None[source]

Define the arguments of this command

Parameters:

parser (CommandParser) – The argument parser

Return type:

None

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

create_parser(prog_name, subcommand, **kwargs)[source]

Create and return the ArgumentParser which will be used to parse the arguments to this command.

execute(*args: Any, **options: Any) None[source]

Try to run the command

Parameters:
  • *args (Any) – The supplied arguments

  • **options (Any) – The supplied keyword options

Raises:

CommandError – When the input is invalid

Return type:

None

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, region_slug: str, **options: Any) None[source]

Try to run the command

Parameters:
  • *args (Any) – The supplied arguments

  • region_slug (str) – The slug of the given region

  • **options (Any) – The supplied keyword options

Raises:

CommandError – When the input is invalid

Return type:

None

help = 'Duplicate all pages of a specific region'[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

Print the help message for this command, derived from self.usage().

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
run_from_argv(argv)[source]

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]
integreat_cms.core.management.commands.duplicate_pages.duplicate_page(old_page: Page, new_parent: Page | None = None) Page[source]

Duplicate a page and insert it as child of the given new parent

Parameters:
  • old_page (Page) – The old page which should be copied

  • new_parent (Page | None) – The new parent where the duplicate should reside

Returns:

The copied page

Return type:

Page

integreat_cms.core.management.commands.duplicate_pages.duplicate_pages(region: Region, old_parent: Page | None = None, new_parent: Page | None = None) None[source]

Duplicate pages recursively for the given region

Parameters:
  • region (Region) – The given region

  • old_parent (Page | None) – The old parent page which descendants should be copied

  • new_parent (Page | None) – The new parent where the duplicates should reside

Return type:

None

Find Large Files

class integreat_cms.core.management.commands.find_large_files.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: LogCommand

Management command to find large media files

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser: CommandParser) None[source]

Define the arguments of this command

Parameters:

parser (CommandParser) – The argument parser

Return type:

None

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

create_parser(prog_name, subcommand, **kwargs)[source]

Create and return the ArgumentParser which will be used to parse the arguments to this command.

execute(*args, **options)[source]

Try to execute this command, performing system checks if needed (as controlled by the requires_system_checks attribute, except if force-skipped).

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, limit: int, threshold: int, **options: Any) None[source]

Try to run the command

Parameters:
  • *args (Any) – The supplied arguments

  • limit (int) – Limit the result to this number

  • threshold (int) – Only show the files larger than this value

  • **options (Any) – The supplied keyword options

Raises:

CommandError – When the input is invalid

Return type:

None

help = 'Find large media files in the CMS'[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

Print the help message for this command, derived from self.usage().

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
run_from_argv(argv)[source]

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]

Find Missing Versions

class integreat_cms.core.management.commands.find_missing_versions.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: LogCommand

Management command to find missing versions

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser: CommandParser) None[source]

Define the arguments of this command

Parameters:

parser (CommandParser) – The argument parser

Return type:

None

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

create_parser(prog_name, subcommand, **kwargs)[source]

Create and return the ArgumentParser which will be used to parse the arguments to this command.

execute(*args, **options)[source]

Try to execute this command, performing system checks if needed (as controlled by the requires_system_checks attribute, except if force-skipped).

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, model: ModelBase, **options: Any) None[source]

Try to run the command

Parameters:
  • *args (Any) – The supplied arguments

  • model (ModelBase) – The model to check

  • **options (Any) – The supplied keyword options

Return type:

None

help = 'Find version inconsistencies in the CMS'[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

Print the help message for this command, derived from self.usage().

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
run_from_argv(argv)[source]

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]
integreat_cms.core.management.commands.find_missing_versions.MODELS: dict[str, ModelBase] = {'event': <class 'integreat_cms.cms.models.events.event_translation.EventTranslation'>, 'page': <class 'integreat_cms.cms.models.pages.page_translation.PageTranslation'>, 'poi': <class 'integreat_cms.cms.models.pois.poi_translation.POITranslation'>}[source]

The possible model choices

{
    'event': <class 'integreat_cms.cms.models.events.event_translation.EventTranslation'>,
    'page': <class 'integreat_cms.cms.models.pages.page_translation.PageTranslation'>,
    'poi': <class 'integreat_cms.cms.models.pois.poi_translation.POITranslation'>,
}
integreat_cms.core.management.commands.find_missing_versions.get_model(model_str: str) ModelBase[source]

Convert a model string to a translation model class

Parameters:

model_str (str) – The model string

Returns:

The model class

Raises:

ArgumentTypeError – When the input is invalid

Return type:

ModelBase

Firebase Data Backup

class integreat_cms.core.management.commands.firebase_data_backup.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: LogCommand

Management command for backing up Firebase Cloud Messaging (FCM) data.

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser)[source]

Entry point for subclassed commands to add custom arguments.

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

property client: FirebaseDataClient[source]

Lazy version of the firebase data client because otherwise the documentation build fails.

create_parser(prog_name, subcommand, **kwargs)[source]

Create and return the ArgumentParser which will be used to parse the arguments to this command.

execute(*args, **options)[source]

Try to execute this command, performing system checks if needed (as controlled by the requires_system_checks attribute, except if force-skipped).

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, **options: Any) None[source]

The actual logic of the command. Subclasses must implement this method.

Parameters:
  • args (Any)

  • options (Any)

Return type:

None

help: str = 'Back up Firebase Cloud Messaging (FCM) data.'[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

Print the help message for this command, derived from self.usage().

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
run_from_argv(argv)[source]

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]

Hix Bulk

class integreat_cms.core.management.commands.hix_bulk.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: LogCommand

Command to calculate the hix values for public page translations which do not currently have a score

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser: CommandParser) None[source]

Define the arguments of this command

Parameters:

parser (CommandParser) – The argument parser

Return type:

None

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

create_parser(prog_name, subcommand, **kwargs)[source]

Create and return the ArgumentParser which will be used to parse the arguments to this command.

execute(*args, **options)[source]

Try to execute this command, performing system checks if needed (as controlled by the requires_system_checks attribute, except if force-skipped).

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, region_slugs: list[str], **options: Any) None[source]

Try to run the command

Parameters:
  • *args (Any) – The supplied arguments

  • region_slugs (list[str]) – The slugs of the given regions

  • **options (Any) – The supplied keyword options

Return type:

None

help = 'Calculates and stores the hix value for all public page translations for which it is missing'[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

Print the help message for this command, derived from self.usage().

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
run_from_argv(argv)[source]

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]
integreat_cms.core.management.commands.hix_bulk.calculate_hix_for_region(region: Region) None[source]

Calculates the hix score for all missing pages in the region. Assumes that hix is globally enabled and enabled for the region

Parameters:

region (Region) – The region

Return type:

None

Import Events

class integreat_cms.core.management.commands.import_events.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: LogCommand

Management command to import events from external calendars

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser)[source]

Entry point for subclassed commands to add custom arguments.

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

create_parser(prog_name, subcommand, **kwargs)[source]

Create and return the ArgumentParser which will be used to parse the arguments to this command.

execute(*args, **options)[source]

Try to execute this command, performing system checks if needed (as controlled by the requires_system_checks attribute, except if force-skipped).

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, **options: Any) None[source]

Try to run the command

Parameters:
  • *args (Any) – The supplied arguments

  • **options (Any) – The supplied keyword options

Return type:

None

help: str = 'Import events from external calendars'[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

Print the help message for this command, derived from self.usage().

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
run_from_argv(argv)[source]

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]

Import POIs From Csv

class integreat_cms.core.management.commands.import_pois_from_csv.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: LogCommand

Management command to import POIs from CSV

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser: CommandParser) None[source]

Define the arguments of this command

Parameters:

parser (CommandParser) – The argument parser

Return type:

None

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

autocomplete_address(poi: dict) dict[source]

Fill in missing address details

Parameters:

poi (dict) – The input POI dict

Returns:

The updated POI dict

Return type:

dict

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

create_parser(prog_name, subcommand, **kwargs)[source]

Create and return the ArgumentParser which will be used to parse the arguments to this command.

execute(*args, **options)[source]

Try to execute this command, performing system checks if needed (as controlled by the requires_system_checks attribute, except if force-skipped).

get_category(category_name: str, default_language: Language) POICategory[source]

Get a POI category object from the category’s name

Parameters:
  • category_name (str) – The translated name of the category

  • default_language (Language) – The default language of the current region

Returns:

The given POI category

Return type:

POICategory

get_opening_hours(poi: dict) list[source]

Parse the opening hour columns into our JSON structure

Parameters:

poi (dict) – The input POI dict

Returns:

The opening hour list

Return type:

list

get_or_create_default_category(default_language: Language) POICategory[source]

Get the default POI category or create if not exists

Parameters:

default_language (Language) – The default language of the current region

Returns:

The default POI category

Return type:

POICategory

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, csv_filename: str, region_slug: str, username: str, **options: Any) None[source]

Try to run the command

Parameters:
  • *args (Any) – The supplied arguments

  • csv_filename (str) – The source CSV file to import from

  • region_slug (str) – Import the POI objects into this region

  • username (str) – The username of the creator

  • **options (Any) – The supplied keyword options

Raises:

CommandError – When the input is invalid

Return type:

None

help = 'Import POIs from CSV'[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

Print the help message for this command, derived from self.usage().

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
run_from_argv(argv)[source]

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]
integreat_cms.core.management.commands.import_pois_from_csv.strtobool(val: str) bool[source]

A slightly adapted variant of strtobool which treats an empty string as false

Parameters:

val (str) – The value as string

Returns:

The value as boolean

Return type:

bool

Repair Tree

class integreat_cms.core.management.commands.repair_tree.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: LogCommand

Management command to repair a broken Treebeard page tree

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser: CommandParser) None[source]

Define the arguments of this command

Parameters:

parser (CommandParser) – The argument parser

Return type:

None

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

create_parser(prog_name, subcommand, **kwargs)[source]

Create and return the ArgumentParser which will be used to parse the arguments to this command.

execute(*args, **options)[source]

Try to execute this command, performing system checks if needed (as controlled by the requires_system_checks attribute, except if force-skipped).

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, page_id: int, commit: bool, **options: Any) None[source]

Try to run the command

Parameters:
  • args (Any)

  • page_id (int)

  • commit (bool)

  • options (Any)

Return type:

None

help = 'Repair broken tree structure'[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

Print the help message for this command, derived from self.usage().

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
run_from_argv(argv)[source]

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]

Reset Mt Budget

class integreat_cms.core.management.commands.reset_mt_budget.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: LogCommand

Management command to reset MT budget

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser: CommandParser) None[source]

Define the arguments of this command

Parameters:

parser (CommandParser) – The argument parser

Return type:

None

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

create_parser(prog_name, subcommand, **kwargs)[source]

Create and return the ArgumentParser which will be used to parse the arguments to this command.

execute(*args, **options)[source]

Try to execute this command, performing system checks if needed (as controlled by the requires_system_checks attribute, except if force-skipped).

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, force: bool, **options: Any) None[source]

Try to run the command

Parameters:
  • args (Any)

  • force (bool)

  • options (Any)

Return type:

None

help: str = 'Reset MT budget'[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

Print the help message for this command, derived from self.usage().

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
run_from_argv(argv)[source]

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]

Send Push Notifications

class integreat_cms.core.management.commands.send_push_notifications.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: LogCommand

Management command to send timed push notifications

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser)[source]

Entry point for subclassed commands to add custom arguments.

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

create_parser(prog_name, subcommand, **kwargs)[source]

Create and return the ArgumentParser which will be used to parse the arguments to this command.

execute(*args, **options)[source]

Try to execute this command, performing system checks if needed (as controlled by the requires_system_checks attribute, except if force-skipped).

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, **options: Any) None[source]

Try to run the command

Parameters:
  • *args (Any) – The supplied arguments

  • **options (Any) – The supplied keyword options

Return type:

None

help: str = 'Send pending push notifications'[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

Print the help message for this command, derived from self.usage().

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
run_from_argv(argv)[source]

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.

send_push_notification(counter: int, total: int, push_notification: PushNotification) None[source]

Sends a push notification

Parameters:
  • counter (int) – The current counter

  • total (int) – How many push notifications are scheduled for this slot

  • push_notification (PushNotification) – The push notification object

Return type:

None

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]

SUMM.AI Bulk

class integreat_cms.core.management.commands.summ_ai_bulk.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: LogCommand

Management command to create an initial translation for Easy German via SUMM.AI

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
add_arguments(parser: CommandParser) None[source]

Define the arguments of this command

Parameters:

parser (CommandParser) – The argument parser

Return type:

None

add_base_argument(parser, *args, **kwargs)[source]

Call the parser’s add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.

base_stealth_options = ('stderr', 'stdout')[source]
check(app_configs=None, tags=None, display_num_errors=False, include_deployment_checks=False, fail_level=40, databases=None)[source]

Use the system check framework to validate entire Django project. Raise CommandError for any serious message (error or critical errors). If there are only light messages (like warnings), print them to stderr and don’t raise an exception.

check_migrations()[source]

Print a warning if the set of migrations on disk don’t match the migrations in the database.

create_parser(prog_name, subcommand, **kwargs)[source]

Create and return the ArgumentParser which will be used to parse the arguments to this command.

execute(*args, **options)[source]

Try to execute this command, performing system checks if needed (as controlled by the requires_system_checks attribute, except if force-skipped).

get_version()[source]

Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.

handle(*args: Any, region_slug: str, username: str, initial: bool, **options: Any) None[source]

Try to run the command

Parameters:
  • *args (Any) – The supplied arguments

  • region_slug (str) – The slug of the given region

  • username (str) – The username of the creator

  • initial (bool) – Whether existing translations should not be updated

  • **options (Any) – The supplied keyword options

Return type:

None

help: str = 'Creates an initial translation for Easy German via SUMM.AI'[source]
output_transaction = False[source]
print_help(prog_name, subcommand)[source]

Print the help message for this command, derived from self.usage().

requires_migrations_checks = False[source]
requires_system_checks = '__all__'[source]
run_from_argv(argv)[source]

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.

set_logging_stream() None[source]

Set the output stream to the command’s stdout/stderr wrapper. Has to be called as part of the command’s handle() function.

Return type:

None

stealth_options = ()[source]
suppressed_base_arguments = {}[source]
integreat_cms.core.management.commands.summ_ai_bulk.summ_ai_bulk(region: Region, username: str, initial: bool = True) None[source]

Translate a complete region into Easy German

Parameters:
  • region (Region) – The current region

  • username (str) – The username of the creator of the translation objects

  • initial (bool) – Whether existing translations should not be updated

Return type:

None