38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
|
|
from django.db import migrations, models
|
||
|
|
|
||
|
|
|
||
|
|
def seed_wallet_applets(apps, schema_editor):
|
||
|
|
Applet = apps.get_model('applets', 'Applet')
|
||
|
|
for slug, name, cols, rows in [
|
||
|
|
('wallet-balances', 'Wallet Balances', 3, 3),
|
||
|
|
('wallet-tokens', 'Wallet Tokens', 3, 3),
|
||
|
|
('wallet-payment', 'Payment Methods', 6, 2),
|
||
|
|
]:
|
||
|
|
Applet.objects.get_or_create(
|
||
|
|
slug=slug,
|
||
|
|
defaults={'name': name, 'grid_cols': cols, 'grid_rows': rows, 'context': 'wallet'},
|
||
|
|
)
|
||
|
|
|
||
|
|
|
||
|
|
class Migration(migrations.Migration):
|
||
|
|
dependencies = [
|
||
|
|
('applets', '0002_seed_applets'),
|
||
|
|
]
|
||
|
|
|
||
|
|
operations = [
|
||
|
|
migrations.AlterField(
|
||
|
|
model_name='applet',
|
||
|
|
name='context',
|
||
|
|
field=models.CharField(
|
||
|
|
choices=[
|
||
|
|
('dashboard', 'Dashboard'),
|
||
|
|
('gameboard', 'Gameboard'),
|
||
|
|
('wallet', 'Wallet'),
|
||
|
|
],
|
||
|
|
default='dashboard',
|
||
|
|
max_length=20,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
migrations.RunPython(seed_wallet_applets, migrations.RunPython.noop),
|
||
|
|
]
|