All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
New dailystone app with 207 minerals scraped from Wikipedia. Each day displays a different mineral with photos, formula, properties, description, and history. Page theme color matches the mineral's typical appearance. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
621 B
Python
23 lines
621 B
Python
"""
|
|
Export mineral data as a JSON fixture for loading on the production server.
|
|
|
|
Usage:
|
|
python manage.py export_minerals > dailystone/fixtures/minerals.json
|
|
python manage.py loaddata dailystone/fixtures/minerals.json
|
|
"""
|
|
import json
|
|
import sys
|
|
|
|
from django.core.management.base import BaseCommand
|
|
from django.core import serializers
|
|
|
|
from dailystone.models import Mineral
|
|
|
|
|
|
class Command(BaseCommand):
|
|
help = 'Export mineral data as a Django fixture (JSON)'
|
|
|
|
def handle(self, *args, **options):
|
|
data = serializers.serialize('json', Mineral.objects.all(), indent=2)
|
|
self.stdout.write(data)
|