Files
k-boris-website/dailystone/models.py
Boris 8a162afe2a
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Add Russian translations and pronunciation button
- Russian fields on Mineral model (name_ru, description_ru, history_ru, etc.)
- scrape_minerals_ru management command fetches from Russian Wikipedia via langlinks
- EN/RU toggle in header, saved to localStorage
- Speaker button next to mineral name uses Web Speech API
- Section headers and labels translated
- Russian Wikipedia link in footer when in RU mode

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 22:54:46 +03:00

33 lines
1.4 KiB
Python

from django.db import models
class Mineral(models.Model):
name = models.CharField(max_length=200, unique=True)
formula = models.CharField(max_length=200, blank=True)
category = models.CharField(max_length=200, blank=True)
crystal_system = models.CharField(max_length=200, blank=True)
mohs_hardness = models.CharField(max_length=50, blank=True)
luster = models.CharField(max_length=200, blank=True)
streak = models.CharField(max_length=200, blank=True)
specific_gravity = models.CharField(max_length=100, blank=True)
color_description = models.CharField(max_length=300, blank=True)
color_hex = models.CharField(max_length=7, default='#6b7280')
description = models.TextField(blank=True)
history = models.TextField(blank=True)
image_urls = models.JSONField(default=list)
wikipedia_url = models.URLField(max_length=500, blank=True)
day_of_year = models.IntegerField(unique=True, null=True, blank=True)
# Russian translations
name_ru = models.CharField(max_length=200, blank=True)
description_ru = models.TextField(blank=True)
history_ru = models.TextField(blank=True)
color_description_ru = models.CharField(max_length=300, blank=True)
wikipedia_url_ru = models.URLField(max_length=500, blank=True)
class Meta:
ordering = ['day_of_year']
def __str__(self):
return self.name