<commit_before>from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.contrib.auth.models import User


@python_2_unicode_compatible
class Photo(models.Model):
    user = models.OneToOneField(
        User,
        related_name='photo',
        null=False
    )

    img = models.ImageField(blank=True)

    title = models.CharField(max_length=255)
    description = models.TextField()

    date_created = models.DateTimeField(auto_now_add=True)
    date_modified = models.DateTimeField(null=True, blank=True)
    date_published = models.DateTimeField(null=True, blank=True)

    published = models.CharField(max_length=15)

    objects = models.Manager()

    def __str__(self):
        return "Photo owned by {}".format(self.user.username)


@python_2_unicode_compatible
class Album(models.Model):
    user = models.ForeignKey(
        User,
        related_name='albums',
        null=False
    )

    photos = models.ManyToManyField(
        Photo,
        related_name='albums',
    )

    title = models.CharField(max_length=255)
    description = models.CharField(max_length=255)
    date_created = models.DateTimeField(auto_now_add=True)
    date_modified = models.DateTimeField()
    date_published = models.DateTimeField()
    cover = models.ForeignKey(
        Photo,
        related_name='album_cover')

    def __str__(self):
        return "{}'s album".format(self.user.username)<commit_msg>updated Photo to have ForeignKey rel; Album has objects manager<commit_after>from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.contrib.auth.models import User


@python_2_unicode_compatible
class Photo(models.Model):
    user = models.ForeignKey(
        User,
        related_name='photos',
        null=False
    )

    img = models.ImageField(blank=True)

    title = models.CharField(max_length=255)
    description = models.TextField()

    date_created = models.DateTimeField(auto_now_add=True)
    date_modified = models.DateTimeField(null=True, blank=True)
    date_published = models.DateTimeField(null=True, blank=True)

    published = models.CharField(max_length=15)

    objects = models.Manager()

    def __str__(self):
        return "Photo owned by {}".format(self.user.username)


@python_2_unicode_compatible
class Album(models.Model):
    user = models.ForeignKey(
        User,
        related_name='albums',
        null=False
    )

    photos = models.ManyToManyField(
        Photo,
        related_name='albums',
    )

    title = models.CharField(max_length=255)
    description = models.CharField(max_length=255)
    date_created = models.DateTimeField(auto_now_add=True)
    date_modified = models.DateTimeField()
    date_published = models.DateTimeField()
    cover = models.ForeignKey(
        Photo,
        related_name='album_cover')

    objects = models.Manager()

    def __str__(self):
        return "{}'s album".format(self.user.username)
{'fraction_non_alphanumeric': 0.09946416610850636, 'fraction_numerical': 0.009377093101138647, 'mean_word_length': 3.4917293233082707, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2744421', 'n_tokens_mistral': 910, 'n_tokens_neox': 864, 'n_words': 162}