new applets app for cross-board usage of Applet() & UserApplet() models; dashboard migrations reset and apps reseeded w. new default specs; core.settings & many tests thru-out suite updated accordingly
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
29
src/apps/applets/migrations/0002_seed_applets.py
Normal file
29
src/apps/applets/migrations/0002_seed_applets.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def seed_applets(apps, schema_editor):
|
||||
Applet = apps.get_model('applets', 'Applet')
|
||||
for slug, name, cols, rows, context in [
|
||||
('wallet', 'Wallet', 12, 3, 'dashboard'),
|
||||
('new-list', 'New List', 9, 3, 'dashboard'),
|
||||
('my-lists', 'My Lists', 3, 3, 'dashboard'),
|
||||
('username', 'Username', 6, 3, 'dashboard'),
|
||||
('palette', 'Palette', 6, 3, 'dashboard'),
|
||||
('new-game', 'New Game', 4, 2, 'gameboard'),
|
||||
('my-games', 'My Games', 4, 4, 'gameboard'),
|
||||
('game-kit', 'Game Kit', 4, 2, 'gameboard'),
|
||||
]:
|
||||
Applet.objects.get_or_create(
|
||||
slug=slug,
|
||||
defaults={'name': name, 'grid_cols': cols, 'grid_rows': rows, 'context': context},
|
||||
)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('applets', '0001_initial')
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(seed_applets, migrations.RunPython.noop)
|
||||
]
|
||||
Reference in New Issue
Block a user