from django.db import models


class House(models.Model):
    firstname = models.CharField(max_length=50)
    lastname = models.CharField(max_length=50)
    city = models.CharField(max_length=100)
    number_of_people = models.IntegerField()
    has_child = models.IntegerField()

    def __str__(self):
        return self.firstname + ' ' + self.lastname


class Energy(models.Model):
    label = models.IntegerField()
    house = models.ForeignKey(House, on_delete=models.CASCADE)
    year = models.IntegerField()
    month = models.IntegerField()
    temperature = models.FloatField()
    daylight = models.FloatField()
    energy_production = models.FloatField()

    def __str__(self):
        return self.label
