<commit_before># -*- Coding:Utf-8 -*-
"""Define Imager Profile models."""
from django.db import models
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible
from django.conf import settings
from django.forms import ModelForm


class ActiveProfileManager(models.Manager):
    """Define an Active Profile Manager class."""

    def get_queryset(self):
        """Return a list of all active users."""
        qs = super(ActiveProfileManager, self).get_queryset()
        return qs.filter(user__is_active__exact=True)


LOCATION = (
    ('North America', 'North America'),
    ('Asia', 'Asia'),
    ('Africa', 'Africa'),
    ('South America', 'South America'),
    ('Europe', 'Europe'),
)


@python_2_unicode_compatible
class UserProfile(models.Model):
    """Create a unique profile for a user."""

    user = models.OneToOneField(
        settings.AUTH_USER_MODEL,
        on_delete=models.CASCADE,
        related_name="profile",
        primary_key=True,
    )
    camera_type = models.CharField(max_length=30, blank=True)
    address = models.CharField(max_length=60, blank=True)
    web_link = models.CharField(max_length=70, blank=True)
    photo_type = models.CharField(max_length=30, blank=True)
    social_media = models.CharField(max_length=30, blank=True)
    region = models.CharField(max_length=30, choices=LOCATION,
                              default='North America')

    friends = models.ManyToManyField("self", symmetrical=False,
                                     related_name='friend_of')
    objects = models.Manager()
    active = ActiveProfileManager()

    @property
    def is_active(self):
        """Property to define if user is active."""
        return self.user.is_active

    def __str__(self):
        """Hand back username's profile."""
        return "{}'s profile".format(self.user.username)


class EditProfile(ModelForm):

    class Meta:
        model = UserProfile
        fields = ['camera_type', 'address', 'web_link', 'photo_type', 'social_media', 'region']<commit_msg>User Model Created.<commit_after># -*- Coding:Utf-8 -*-
"""Define Imager Profile models."""
from django.db import models
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible
from django.conf import settings
from django.forms import ModelForm


class ActiveProfileManager(models.Manager):
    """Define an Active Profile Manager class."""

    def get_queryset(self):
        """Return a list of all active users."""
        qs = super(ActiveProfileManager, self).get_queryset()
        return qs.filter(user__is_active__exact=True)


LOCATION = (
    ('North America', 'North America'),
    ('Asia', 'Asia'),
    ('Africa', 'Africa'),
    ('South America', 'South America'),
    ('Europe', 'Europe'),
)


@python_2_unicode_compatible
class UserProfile(models.Model):
    """Create a unique profile for a user."""

    user = models.OneToOneField(
        settings.AUTH_USER_MODEL,
        on_delete=models.CASCADE,
        related_name="profile",
        primary_key=True,
    )
    camera_type = models.CharField(max_length=30, blank=True)
    address = models.CharField(max_length=60, blank=True)
    web_link = models.CharField(max_length=70, blank=True)
    photo_type = models.CharField(max_length=30, blank=True)
    social_media = models.CharField(max_length=30, blank=True)
    region = models.CharField(max_length=30, choices=LOCATION,
                              default='North America')

    friends = models.ManyToManyField("self", symmetrical=False,
                                     related_name='friend_of')
    objects = models.Manager()
    active = ActiveProfileManager()

    @property
    def is_active(self):
        """Property to define if user is active."""
        return self.user.is_active

    def __str__(self):
        """Hand back username's profile."""
        return "{}'s profile".format(self.user.username)


class EditYser(ModelForm):

    class Meta:
        model = settings.AUTH_USER_MODEL
        fields = ['first_name', 'last_name', 'email_address']


class EditProfile(ModelForm):

    class Meta:
        model = UserProfile
        fields = ['camera_type', 'address', 'web_link', 'photo_type', 'social_media', 'region']
{'fraction_non_alphanumeric': 0.12222999766736646, 'fraction_numerical': 0.006997900629811057, 'mean_word_length': 3.3313131313131312, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2213970', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1210, 'n_words': 293}