<commit_before>"""Define image models."""

from django.db import models
from imager_profile.models import UserProfile

# Create yo  models here.

SHARING = (
    ('PRIVATE', "Private"),
    ('SHARED', "Shared"),
    ('PUBLIC', "Public"),
)


class Photo(models.Model):
    """One individaul photo."""

    image_file = models.ImageField(upload_to="")
    title = models.CharField(max_length=255, blank=True, null=True)
    description = models.CharField(max_length=255, blank=True, null=True)
    date_uploaded = models.DateField(auto_now_add=True)
    date_modified = models.DateField(blank=True, null=True)
    date_published = models.DateField(blank=True, null=True)

    photographer = models.ForeignKey(UserProfile,
                                        related_name='photo',
                                        blank=True,
                                        null=True)

    published = models.CharField(max_length=255,
                                 choices=SHARING,
                                 blank=True,
                                 null=True)


class Album(models.Model):
    """Album class, one user, many photos."""

    owner = models.ForeignKey(UserProfile,
                              related_name="albums",
                              blank=True,
                              null=True)

    contents = models.ManyToManyField(Photo,
                                      related_name='in_album',<commit_msg>removed blank fields for relationships<commit_after>"""Define image models."""

from django.db import models
from imager_profile.models import UserProfile
from django.utils.encoding import python_2_unicode_compatible

# Create yo  models here.

SHARING = (
    ('PRIVATE', "Private"),
    ('SHARED', "Shared"),
    ('PUBLIC', "Public"),
)


@python_2_unicode_compatible
class Photo(models.Model):
    """One individaul photo."""

    image_file = models.ImageField(upload_to="")
    title = models.CharField(max_length=255, blank=True, null=True)
    description = models.CharField(max_length=255, blank=True, null=True)
    date_uploaded = models.DateField(auto_now_add=True)
    date_modified = models.DateField(blank=True, null=True)
    date_published = models.DateField(blank=True, null=True)

    photographer = models.ForeignKey(UserProfile,
                                     related_name='photo',
                                     )

    published = models.CharField(max_length=255,
                                 choices=SHARING,
                                 blank=True,
                                 null=True)


@python_2_unicode_compatible
class Album(models.Model):
    """Album class, one user, many photos."""

    owner = models.ForeignKey(UserProfile,
                              related_name="albums",
                              )

    contents = models.ManyToManyField(Photo,
                                      related_name='in_album',
{'fraction_non_alphanumeric': 0.10317731465664502, 'fraction_numerical': 0.00717458148274684, 'mean_word_length': 1.9908069458631257, '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': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '503814', 'n_tokens_mistral': 793, 'n_tokens_neox': 754, 'n_words': 147}