Commands
Bulk Replace Page Icons
- class integreat_cms.core.management.commands.bulk_replace_page_icons.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]
Bases:
LogCommand
Management command to change references of media files from a source path to a target path. This command reads a CSV file and then changes the reference from the first and second column (source region and path) to the one of the third and fourth column (target region and path).
Copy POIs
- class integreat_cms.core.management.commands.copy_pois.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]
Bases:
BaseCommand
- add_arguments(parser: CommandParser) None [source]
Define the arguments of this command
- Parameters:
parser (CommandParser) – The argument parser
- Return type:
None
- integreat_cms.core.management.commands.copy_pois.copy_icon(region: Region, obj: POI | Event) None [source]
Ensure the icon of an object is accessible from the target region as well
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
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
- add_arguments(parser: CommandParser) None [source]
Define the arguments of this command
- Parameters:
parser (CommandParser) – The argument parser
- Return type:
None
- 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
- 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
Fetch Page Accesses
- class integreat_cms.core.management.commands.fetch_page_accesses.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]
Bases:
LogCommand
Management command to fetch page accesses from matomo
- add_arguments(parser: CommandParser) None [source]
Define the arguments of this command
- Parameters:
parser (CommandParser) – The argument parser
- 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
- add_arguments(parser: CommandParser) None [source]
Define the arguments of this command
- Parameters:
parser (CommandParser) – The argument parser
- Return type:
None
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
- 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.
- property client: FirebaseDataClient[source]
Lazy version of the firebase data client because otherwise the documentation build fails.
Fix Internal Links
- class integreat_cms.core.management.commands.fix_internal_links.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]
Bases:
LogCommand
Management command to automatically fix broken internal links in the whole content Links will be fixed in three cases: 1. A parent page has been moved, so the slug is identical but the path is not correct anymore 2. The slug of a page has been changed, so a link might reference an older version of a page 3. A translation has been created, but the links it contains still point to the source language
In none of these cases will the link text be changed.
- add_arguments(parser: CommandParser) None [source]
Define the arguments of this command
- Parameters:
parser (CommandParser) – The argument parser
- Return type:
None
- integreat_cms.core.management.commands.fix_internal_links.get_region(region_slug: str) Region [source]
Get a region object by slug or raise an error if not found
- integreat_cms.core.management.commands.fix_internal_links.get_user(username: str) User [source]
Get a user by username or raise an error if not found
- integreat_cms.core.management.commands.fix_internal_links.replace_link_helper(rules: dict[str, str], link: str) str [source]
Helper function to update a link according to the given rules :param rules: A dict where the keys are the old urls and the values are the new urls :param link: The link to replace according to the rules :return: Returns the updated link if a matching rules is found, otherwise returns it unmodified
- integreat_cms.core.management.commands.fix_internal_links.replace_links_of_translation(translation: AbstractContentTranslation, rules: dict[str, str], user: Any | None, commit: bool) None [source]
Replaces links on a single translation
- Parameters:
translation (AbstractContentTranslation) – The translation to modify
rules (dict[str, str]) – The rules how to replace the links. The keys are the old urls and the values are the new urls
user (Any | None) – The user that should be credited for this action
commit (bool) – Whether to write to the database
- Return type:
None
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
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
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
- add_arguments(parser: CommandParser) None [source]
Define the arguments of this command
- Parameters:
parser (CommandParser) – The argument parser
- Return type:
None
- get_category(category_name: str, default_language: Language) POICategory [source]
Get a POI category object from the category’s name
- Parameters:
- Returns:
The given POI category
- Return type:
- 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:
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
Replace Links
- class integreat_cms.core.management.commands.replace_links.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]
Bases:
LogCommand
Management command to replace links in the whole content
- add_arguments(parser: CommandParser) None [source]
Define the arguments of this command
- Parameters:
parser (CommandParser) – The argument parser
- Return type:
None
- handle(*args: Any, search: str, replace: str, region_slug: str, username: str, commit: bool, **options: Any) None [source]
Try to run the command
- Parameters:
*args (Any) – The supplied arguments
search (str) – The (partial) URL to search
replace (str) – The (partial) URL to replace
region_slug (str) – The slug of the given region
username (str) – The username of the creator
commit (bool) – Whether changes should be written to the database
**options (Any) – The supplied keyword options
- Raises:
CommandError – When the input is invalid
- Return type:
None
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
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
- 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
- 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
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
- add_arguments(parser: CommandParser) None [source]
Define the arguments of this command
- Parameters:
parser (CommandParser) – The argument parser
- Return type:
None
Update Link Text
- class integreat_cms.core.management.commands.update_link_text.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]
Bases:
LogCommand
Management command to update the link text of ALL links with the given URL. ALL links receive the SAME new link text. This applies in ALL regions.
- add_arguments(parser: CommandParser) None [source]
Define the arguments of this command
- Parameters:
parser (CommandParser) – The argument parser
- Return type:
None