Skip to content

Feat/update django telegram app 1 0 0#53

Merged
shifqu merged 7 commits into
mainfrom
feat/update-django-telegram-app-1-0-0
Nov 25, 2025
Merged

Feat/update django telegram app 1 0 0#53
shifqu merged 7 commits into
mainfrom
feat/update-django-telegram-app-1-0-0

Conversation

@shifqu

@shifqu shifqu commented Nov 25, 2025

Copy link
Copy Markdown
Owner

No description provided.

This app contains base classes to be used in this
project. They subclass the base classes of
django_telegram_app, but with project-specific fields
and behaviour.

The settings have also been update to include telegram
in INSTALLED_APPS, use a swapped telegram_settings model
and hide the ModelAdmin for telegram_settings model as we
use the inlined one on the user
These references have been replaced to point to the custom
TelegramCommand and TelegramStep for better type inference.

Management commands now point to IdaBaseManagementCommand to
ensure it's localized and only ran for active users
django-telegram-app renamed their BaseCommand and BaseTelegramCommand
to BaseBotCommand and BaseManagementCommand respectively
for management commands we just update references to
BaseManagementCommand.

for bot commands we change the calls to create callbacks
to the new style where we pass original_data and then kwargs
@shifqu

shifqu commented Nov 25, 2025

Copy link
Copy Markdown
Owner Author

This has some breaking changes and we reintroduce telegram app, so we need to run some custom scripts on the instance again.

1. Run this

import sqlite3

# Connect sqlite3 db.sqlite3
conn = sqlite3.connect("db.sqlite3")
cursor = conn.cursor()
# Reset django_migrations entries for telegram
cursor.execute("""
DELETE FROM django_migrations
WHERE app='telegram';
""")
# Commit and close connection
conn.commit()
conn.close()

2. Run migrations

manage migrate

3. Run this

import sqlite3

# Connect sqlite3 db.sqlite3
conn = sqlite3.connect("db.sqlite3")
cursor = conn.cursor()
# Move data from django_telegram_app_telegramsettings to telegram_telegramsettings
cursor.execute("""
INSERT INTO telegram_telegramsettings (id, chat_id, data, updated_at, user_id)
SELECT id, chat_id, data, updated_at, user_id FROM django_telegram_app_telegramsettings;
""")
# truncate django_telegram_app_telegramsettings table
cursor.execute("""
DELETE FROM django_telegram_app_telegramsettings;
""")
# Commit and close connection
conn.commit()
conn.close()

@shifqu shifqu merged commit a8fb8e3 into main Nov 25, 2025
2 checks passed
@shifqu shifqu deleted the feat/update-django-telegram-app-1-0-0 branch November 25, 2025 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant