from django.db import models


class WeatherRecord(models.Model):
    date         = models.DateField(unique=True, verbose_name="日付")
    temp_mean    = models.FloatField(null=True, blank=True, verbose_name="平均気温(℃)")
    temp_max     = models.FloatField(null=True, blank=True, verbose_name="最高気温(℃)")
    temp_min     = models.FloatField(null=True, blank=True, verbose_name="最低気温(℃)")
    sunshine_h   = models.FloatField(null=True, blank=True, verbose_name="日照時間(h)")
    precip_mm    = models.FloatField(null=True, blank=True, verbose_name="降水量(mm)")
    wind_max     = models.FloatField(null=True, blank=True, verbose_name="最大風速(m/s)")
    pressure_min = models.FloatField(null=True, blank=True, verbose_name="最低気圧(hPa)")

    class Meta:
        verbose_name = "気象記録"
        verbose_name_plural = "気象記録"
        ordering = ['date']

    def __str__(self):
        return str(self.date)
