migrate to opus-magnum app
This commit is contained in:
parent
35ea54ecea
commit
5584e54b58
@ -17,7 +17,7 @@ from animations.schemas import (
|
|||||||
WinnerResponseOut,
|
WinnerResponseOut,
|
||||||
WinnerFileOut,
|
WinnerFileOut,
|
||||||
)
|
)
|
||||||
from submissions.models import PuzzleResponse, SteamCollectionItem, SteamCollection
|
from opus_magnum.models import PuzzleResponse, SteamCollectionItem, SteamCollection
|
||||||
|
|
||||||
|
|
||||||
router = Router()
|
router = Router()
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
from ninja import ModelSchema, Schema
|
from ninja import ModelSchema, Schema
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
from submissions.models import PuzzleResponse
|
from opus_magnum.models import PuzzleResponse
|
||||||
from submissions.schemas import SteamCollectionItemOut
|
from opus_magnum.schemas import SteamCollectionItemOut
|
||||||
|
|
||||||
|
|
||||||
class PuzzleResponseRankingOut(ModelSchema):
|
class PuzzleResponseRankingOut(ModelSchema):
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.utils.html import format_html
|
from django.utils.html import format_html
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from submissions.models import (
|
from opus_magnum.models import (
|
||||||
SteamAPIKey,
|
SteamAPIKey,
|
||||||
SteamCollection,
|
SteamCollection,
|
||||||
SteamCollectionItem,
|
SteamCollectionItem,
|
||||||
@ -10,7 +10,7 @@ from django.shortcuts import get_object_or_404
|
|||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from games.decorators import require_game_enabled
|
from games.decorators import require_game_enabled
|
||||||
from submissions.utils import verify_and_validate_ocr_date_for_submission
|
from opus_magnum.utils import verify_and_validate_ocr_date_for_submission
|
||||||
from ninja.decorators import decorate_view
|
from ninja.decorators import decorate_view
|
||||||
|
|
||||||
from .models import (
|
from .models import (
|
||||||
@ -1,6 +1,6 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
|
||||||
class SubmissionsConfig(AppConfig):
|
class OpusMagnumConfig(AppConfig):
|
||||||
default_auto_field = "django.db.models.BigAutoField"
|
default_auto_field = "django.db.models.BigAutoField"
|
||||||
name = "submissions"
|
name = "opus_magnum"
|
||||||
@ -3,8 +3,8 @@ Django management command to fetch Steam Workshop collections
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from django.core.management.base import BaseCommand, CommandError
|
from django.core.management.base import BaseCommand, CommandError
|
||||||
from submissions.utils import create_or_update_collection
|
from opus_magnum.utils import create_or_update_collection
|
||||||
from submissions.models import SteamAPIKey, SteamCollection
|
from opus_magnum.models import SteamAPIKey, SteamCollection
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
@ -34,7 +34,7 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# Check if collection already exists
|
# Check if collection already exists
|
||||||
from submissions.utils import SteamCollectionFetcher
|
from opus_magnum.utils import SteamCollectionFetcher
|
||||||
|
|
||||||
fetcher = SteamCollectionFetcher(api_key.api_key)
|
fetcher = SteamCollectionFetcher(api_key.api_key)
|
||||||
collection_id = fetcher.extract_collection_id(url)
|
collection_id = fetcher.extract_collection_id(url)
|
||||||
@ -1,6 +1,6 @@
|
|||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from submissions.utils import verify_and_validate_ocr_date_for_submission
|
from opus_magnum.utils import verify_and_validate_ocr_date_for_submission
|
||||||
from submissions.models import SubmissionFile
|
from opus_magnum.models import SubmissionFile
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
@ -5,7 +5,7 @@ from django.db import migrations
|
|||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("submissions", "0001_initial"),
|
("opus_magnum", "0001_initial"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -5,7 +5,7 @@ from django.db import migrations, models
|
|||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("submissions", "0002_delete_collection"),
|
("opus_magnum", "0002_delete_collection"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -1,7 +1,7 @@
|
|||||||
# Generated by Django 5.2.7 on 2025-10-29 01:32
|
# Generated by Django 5.2.7 on 2025-10-29 01:32
|
||||||
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
import submissions.models
|
import opus_magnum.models
|
||||||
import uuid
|
import uuid
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@ -9,7 +9,7 @@ from django.db import migrations, models
|
|||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("submissions", "0003_steamapikey"),
|
("opus_magnum", "0003_steamapikey"),
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ class Migration(migrations.Migration):
|
|||||||
"file",
|
"file",
|
||||||
models.FileField(
|
models.FileField(
|
||||||
help_text="Uploaded file (image/gif)",
|
help_text="Uploaded file (image/gif)",
|
||||||
upload_to=submissions.models.submission_file_upload_path,
|
upload_to=opus_magnum.models.submission_file_upload_path,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
@ -5,7 +5,7 @@ from django.db import migrations, models
|
|||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("submissions", "0004_submission_puzzleresponse_submissionfile"),
|
("opus_magnum", "0004_submission_puzzleresponse_submissionfile"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -5,7 +5,7 @@ from django.db import migrations, models
|
|||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("submissions", "0005_alter_submission_notes"),
|
("opus_magnum", "0005_alter_submission_notes"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -5,7 +5,7 @@ from django.db import migrations, models
|
|||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("submissions", "0006_remove_puzzleresponse_ocr_confidence_score_and_more"),
|
("opus_magnum", "0006_remove_puzzleresponse_ocr_confidence_score_and_more"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -5,7 +5,7 @@ from django.db import migrations
|
|||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("submissions", "0007_submission_manual_validation_requested"),
|
("opus_magnum", "0007_submission_manual_validation_requested"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -7,7 +7,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("animations", "0001_initial"),
|
("animations", "0001_initial"),
|
||||||
("submissions", "0008_alter_puzzleresponse_unique_together"),
|
("opus_magnum", "0008_alter_puzzleresponse_unique_together"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -5,7 +5,7 @@ from django.db import migrations, models
|
|||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("submissions", "0009_steamcollectionitem_points_factor"),
|
("opus_magnum", "0009_steamcollectionitem_points_factor"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -5,7 +5,7 @@ from django.db import migrations, models
|
|||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("submissions", "0010_alter_puzzleresponse_validated_area_and_more"),
|
("opus_magnum", "0010_alter_puzzleresponse_validated_area_and_more"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -6,7 +6,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
(
|
(
|
||||||
"submissions",
|
"opus_magnum",
|
||||||
"0011_alter_puzzleresponse_area_alter_puzzleresponse_cost_and_more",
|
"0011_alter_puzzleresponse_area_alter_puzzleresponse_cost_and_more",
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
@ -7,7 +7,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("animations", "0002_puzzlepointsvalue"),
|
("animations", "0002_puzzlepointsvalue"),
|
||||||
("submissions", "0012_alter_puzzleresponse_validated_area_and_more"),
|
("opus_magnum", "0012_alter_puzzleresponse_validated_area_and_more"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -5,7 +5,7 @@ from django.db import migrations, models
|
|||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("submissions", "0013_steamcollectionitem_points_value"),
|
("opus_magnum", "0013_steamcollectionitem_points_value"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@ -4,7 +4,7 @@ Utilities for fetching Steam Workshop collection data using Steam Web API
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
from submissions.models import SteamCollection, SteamCollectionItem, SubmissionFile
|
from opus_magnum.models import SteamCollection, SteamCollectionItem, SubmissionFile
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@ -1,8 +1,8 @@
|
|||||||
from ninja import NinjaAPI
|
from ninja import NinjaAPI
|
||||||
from django.core.cache import cache
|
from django.core.cache import cache
|
||||||
from django.http import HttpRequest
|
from django.http import HttpRequest
|
||||||
from submissions.api import router as submissions_router
|
from opus_magnum.api import router as submissions_router
|
||||||
from submissions.schemas import UserInfoOut
|
from opus_magnum.schemas import UserInfoOut
|
||||||
from animations.api import router as results_router
|
from animations.api import router as results_router
|
||||||
from noita.api import router as noita_router
|
from noita.api import router as noita_router
|
||||||
from games.api import router as games_router
|
from games.api import router as games_router
|
||||||
|
|||||||
@ -41,7 +41,7 @@ INSTALLED_APPS = [
|
|||||||
"django_vite",
|
"django_vite",
|
||||||
"accounts",
|
"accounts",
|
||||||
"animations",
|
"animations",
|
||||||
"submissions",
|
"opus_magnum",
|
||||||
"noita",
|
"noita",
|
||||||
"games",
|
"games",
|
||||||
"market",
|
"market",
|
||||||
|
|||||||
@ -39,7 +39,7 @@ def home(request: HttpRequest):
|
|||||||
@login_required
|
@login_required
|
||||||
@require_game_enabled(OPUS_MAGNUM_APP_ID)
|
@require_game_enabled(OPUS_MAGNUM_APP_ID)
|
||||||
def opus_magnum_home(request: HttpRequest):
|
def opus_magnum_home(request: HttpRequest):
|
||||||
from submissions.models import SteamCollection
|
from opus_magnum.models import SteamCollection
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user