<commit_before>from django.db import models


class Camera(models.Model):
    ssid = models.CharField(max_length=255)
    password = models.CharField(max_length=255)
    date_added = models.DateTimeField(auto_now_add=True)
    last_attempt = models.DateTimeField(auto_now=True)
    last_update = models.DateTimeField(null=True, blank=True)
    image_last_update = models.DateTimeField(null=True, blank=True)
    image = models.TextField(blank=True)
    summary = models.TextField(blank=True)
    status = models.TextField(blank=True)
    connection_attempts = models.IntegerField(default=0)
    connection_failures = models.IntegerField(default=0)

    def __unicode__(self):
        return self.ssid


class Command(models.Model):
    camera = models.ForeignKey(Camera)
    command = models.CharField(max_length=255)
    value = models.CharField(max_length=255)
    date_added = models.DateTimeField(auto_now_add=True)
    time_completed = models.DateTimeField(null=True, blank=True)

    def __unicode__(self):
        return self.camera.__unicode__() + ' > ' + self.command<commit_msg>Fix bug that prevent commands with no values from being added<commit_after>from django.db import models


class Camera(models.Model):
    ssid = models.CharField(max_length=255)
    password = models.CharField(max_length=255)
    date_added = models.DateTimeField(auto_now_add=True)
    last_attempt = models.DateTimeField(auto_now=True)
    last_update = models.DateTimeField(null=True, blank=True)
    image_last_update = models.DateTimeField(null=True, blank=True)
    image = models.TextField(blank=True)
    summary = models.TextField(blank=True)
    status = models.TextField(blank=True)
    connection_attempts = models.IntegerField(default=0)
    connection_failures = models.IntegerField(default=0)

    def __unicode__(self):
        return self.ssid


class Command(models.Model):
    camera = models.ForeignKey(Camera)
    command = models.CharField(max_length=255)
    value = models.CharField(blank=True, max_length=255)
    date_added = models.DateTimeField(auto_now_add=True)
    time_completed = models.DateTimeField(null=True, blank=True)

    def __unicode__(self):
        return self.camera.__unicode__() + ' > ' + self.command
{'fraction_non_alphanumeric': 0.10286225402504472, 'fraction_numerical': 0.012522361359570662, 'mean_word_length': 4.735897435897436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2327120', 'n_tokens_mistral': 705, 'n_tokens_neox': 668, 'n_words': 114}