-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Ajordat/tags
Tags functionality for decks
- Loading branch information
Showing
61 changed files
with
2,203 additions
and
987 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from rest_framework import routers | ||
|
||
from . import views | ||
from api import views | ||
|
||
# Register the available views | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "1.10.1" | ||
__version__ = "1.11.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Generated by Django 5.0.8 on 2024-08-26 13:37 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("decks", "0058_card_created_at"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Tag", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("name", models.CharField(unique=True)), | ||
("description", models.CharField(blank=True)), | ||
("description_de", models.CharField(blank=True, null=True)), | ||
("description_en", models.CharField(blank=True, null=True)), | ||
("description_es", models.CharField(blank=True, null=True)), | ||
("description_fr", models.CharField(blank=True, null=True)), | ||
("description_it", models.CharField(blank=True, null=True)), | ||
( | ||
"type", | ||
models.CharField( | ||
choices=[("TY", "type"), ("SU", "subtype")], max_length=2 | ||
), | ||
), | ||
], | ||
options={ | ||
"ordering": ["-type", "name"], | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name="deck", | ||
name="tags", | ||
field=models.ManyToManyField( | ||
blank=True, related_name="decks", to="decks.tag" | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
from django.db import migrations | ||
|
||
|
||
def init_models(apps): | ||
global Tag | ||
Tag = apps.get_model("decks", "Tag") | ||
|
||
|
||
def delete_tags(apps, schema_editor): | ||
init_models(apps) | ||
|
||
Tag.objects.all().delete() | ||
|
||
|
||
def create_tags(apps, schema_editor): | ||
init_models(apps) | ||
|
||
tags = [] | ||
data = [ | ||
{ | ||
"name": "Aggro", | ||
"type": "TY", | ||
"description_en": "Get an early lead and maintain pressure.", | ||
"description_es": "Toma una ventaja temprana y mantén la presión.", | ||
"description_fr": "Prenez une avance rapide et maintenez la pression.", | ||
"description_it": "Ottieni un vantaggio iniziale e mantieni la pressione.", | ||
"description_de": "Verschaffe dir frühzeitig einen Vorsprung und halte den Druck aufrecht.", | ||
}, | ||
{ | ||
"name": "Midrange", | ||
"type": "TY", | ||
"description_en": "Balance early aggression with late-game stability.", | ||
"description_es": "Equilibra la agresión temprana con estabilidad en el juego tardío.", | ||
"description_fr": "Équilibrez l'agression précoce avec la stabilité en fin de partie.", | ||
"description_it": "Bilancia l'aggressività iniziale con la stabilità a fine partita.", | ||
"description_de": "Balanciere frühe Aggression mit Stabilität im späten Spiel.", | ||
}, | ||
{ | ||
"name": "Control", | ||
"type": "TY", | ||
"description_en": "Aims to prolong the game and gain control for a late win.", | ||
"description_es": "Busca prolongar el juego y ganar control para una victoria tardía.", | ||
"description_fr": "Vise à prolonger la partie et à prendre le contrôle pour une victoire tardive.", | ||
"description_it": "Mira a prolungare il gioco e ottenere il controllo per una vittoria tardiva.", | ||
"description_de": "Zielt darauf ab, das Spiel zu verlängern und die Kontrolle zu übernehmen, um spät zu gewinnen.", | ||
}, | ||
{ | ||
"name": "Combo", | ||
"type": "SU", | ||
"description_en": "Uses card combinations to achieve powerful effects.", | ||
"description_es": "Utiliza combinaciones de cartas para lograr efectos poderosos.", | ||
"description_fr": "Utilise des combinaisons de cartes pour obtenir des effets puissants.", | ||
"description_it": "Utilizza combinazioni di carte per ottenere effetti potenti.", | ||
"description_de": "Nutzt Kartenkombinationen, um mächtige Effekte zu erzielen.", | ||
}, | ||
{ | ||
"name": "Token", | ||
"type": "SU", | ||
"description_en": "Focuses on generating and utilizing token creatures.", | ||
"description_es": "Se centra en generar y utilizar criaturas de fichas.", | ||
"description_fr": "Se concentre sur la génération et l'utilisation de créatures jetons.", | ||
"description_it": "Si concentra sulla generazione e sull'utilizzo di creature token.", | ||
"description_de": "Konzentriert sich auf die Erzeugung und Nutzung von Token-Kreaturen.", | ||
}, | ||
{ | ||
"name": "Disruption", | ||
"type": "SU", | ||
"description_en": "Interferes with the opponent's strategy and resources.", | ||
"description_es": "Interfiere con la estrategia y los recursos del oponente.", | ||
"description_fr": "Interfère avec la stratégie et les ressources de l'adversaire.", | ||
"description_it": "Interferisce con la strategia e le risorse dell'avversario.", | ||
"description_de": "Stört die Strategie und Ressourcen des Gegners.", | ||
}, | ||
{ | ||
"name": "Ramp", | ||
"type": "SU", | ||
"description_en": "Increases resources to play big cards faster.", | ||
"description_es": "Aumenta los recursos para jugar cartas grandes más rápido.", | ||
"description_fr": "Augmente les ressources pour jouer des grandes cartes plus rapidement.", | ||
"description_it": "Aumenta le risorse per giocare carte grandi più velocemente.", | ||
"description_de": "Erhöht Ressourcen, um größere Karten schneller zu spielen.", | ||
}, | ||
] | ||
|
||
for tag_data in data: | ||
|
||
tags.append(Tag(**tag_data)) | ||
|
||
Tag.objects.bulk_create(tags) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("decks", "0059_tag_deck_tags"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(code=create_tags, reverse_code=delete_tags), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.