<commit_before>from __future__ import unicode_literals
from django.db import models


class Plant(models.Model):
    name = models.CharField(max_length=100)

    # Humidity. LOW, MODERATE, HIGH
    ideal_humidity = models.CharField(max_length=100, choices=[('LOW', 'LOW'), ('MODERATE', 'MODERATE'), ('HIGH', 'HIGH')])

    # How often the plant needs fertilizer. In days. Not required
    fertilizing_interval = models.IntegerField(default=0, blank=True,
                                               help_text="How often the plant needs fertilizer (in days)")

    # How much sun the plant prefers on a scale from 0-2. Not required.
    sun_preference = models.IntegerField(default=0, blank=True, help_text="How much sun does the plant prefer (0-2)")

    # How much shade the plant can tolerate on a scale from 0-4. Not required.
    shade_tolerance = models.IntegerField(default=0, blank=True, help_text="How much shade can the plant tolerate (0-4)")

    # Not used for now
    ideal_ph_min = models.DecimalField(max_digits=3, decimal_places=2, default=0, blank=True,
                                       help_text="Minimum ideal pH value")
    ideal_ph_max = models.DecimalField(max_digits=3, decimal_places=2, default=0, blank=True,
                                       help_text="Maximum ideal pH value")

    # image = models.ImageField(...)

    def __str__(self):
        return self.name


class PlantInstance(models.Model):
    date_created = models.DateTimeField(auto_now_add=True)
    plant_type = models.ForeignKey(Plant)
    sensor_offset_max = models.IntegerField(help_text="Humidity sensor offset for calibration (max)", default=0)
    sensor_offset_min = models.IntegerField(help_text="Humidity sensor offset for calibration (min)", default=0)
    pin_number = models.IntegerField(help_text="Pin number of the humidity sensor", default=0)

    def __str__(self):
        return str(self.plant_type.name)<commit_msg>Update models. Make field choices strict<commit_after>from __future__ import unicode_literals
from django.db import models


class Plant(models.Model):
    name = models.CharField(max_length=100)

    # Humidity. LOW, MODERATE, HIGH
    ideal_humidity = models.CharField(max_length=100, choices=[('LOW', 'LOW'), ('MODERATE', 'MODERATE'), ('HIGH', 'HIGH')])

    # How much sun the plant prefers. Not required.
    sun_preference = models.CharField(max_length=100, blank=True, help_text="How much sun the plant prefers",
                                      choices=[('MINIMAL', 'MINIMAL'), ('FULL', 'FULL')])

    # How much shade the plant can tolerate. Not required.
    shade_tolerance = models.CharField(max_length=100, blank=True, help_text="How much shade the plant can tolerate",
                                       choices=[('NONE', 'NONE'), ('LIGHT', 'LIGHT'), ('PERMANENT', 'PERMANENT')])

    # How often the plant needs fertilizer. In days. Not required
    fertilizing_interval = models.IntegerField(default=0, blank=True,
                                               help_text="How often the plant needs fertilizer (in days)")

    # Not used for now
    ideal_ph_min = models.DecimalField(max_digits=3, decimal_places=2, default=-1, blank=True,
                                       help_text="Minimum ideal pH value")
    ideal_ph_max = models.DecimalField(max_digits=3, decimal_places=2, default=-1, blank=True,
                                       help_text="Maximum ideal pH value")

    def __str__(self):
        return self.name


class PlantInstance(models.Model):
    date_created = models.DateTimeField(auto_now_add=True)
    plant_type = models.ForeignKey(Plant)
    sensor_offset_max = models.IntegerField(help_text="Humidity sensor offset for calibration (max)", default=0)
    sensor_offset_min = models.IntegerField(help_text="Humidity sensor offset for calibration (min)", default=0)
    pin_number = models.IntegerField(help_text="Pin number of the humidity sensor", default=0)

    def __str__(self):
        return str(self.plant_type.name)
{'fraction_non_alphanumeric': 0.1051715564395823, 'fraction_numerical': 0.011934361014420686, 'mean_word_length': 3.2526427061310783, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3551010', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1127, 'n_words': 311}