<commit_before>from django.db import models
from django.contrib.auth.models import User
from tags.models import Tag

# Create your models here.

@login_required
class Post(models.Model):
    private = 1
    friend = 2
    FOAF = 3
    server = 4
    public = 5
    visibilityChoices = (
        (private, 'Private'),
        (friend, 'Friend'),
        (FOAF, 'Friend of A Friend'),
        (server, 'Server'),
        (public, 'Public'),
    )

    # 55 characters is (usually) enough to show up in a Google search
    title = models.CharField(max_length=55)
    date = models.DateTimeField()
    # Not sure how to make a "content" field either text or image
    text = models.CharField(max_length=63206, blank=True)
    image = models.ImageField(blank=True, upload_to='/images/')
    origin = models.GenericIPAddressField()
    source = models.GenericIPAddressField()
    author = models.ForeignKey(User)
    # Tags that can be used to filter posts
    tags = models.ManyToManyField(Tag, blank=True)
    visibility = models.IntegerField(choices=visibilityChoices)

    def __unicode__(self):
        return self.title<commit_msg>Don't do required login for this! THIS IS A MODEL!<commit_after>from django.db import models
from django.contrib.auth.models import User
from tags.models import Tag

# Create your models here.

class Post(models.Model):
    private = 1
    friend = 2
    FOAF = 3
    server = 4
    public = 5
    visibilityChoices = (
        (private, 'Private'),
        (friend, 'Friend'),
        (FOAF, 'Friend of A Friend'),
        (server, 'Server'),
        (public, 'Public'),
    )

    # 55 characters is (usually) enough to show up in a Google search
    title = models.CharField(max_length=55)
    date = models.DateTimeField()
    # Not sure how to make a "content" field either text or image
    text = models.CharField(max_length=63206, blank=True)
    image = models.ImageField(blank=True, upload_to='/images/')
    origin = models.GenericIPAddressField()
    source = models.GenericIPAddressField()
    author = models.ForeignKey(User)
    # Tags that can be used to filter posts
    tags = models.ManyToManyField(Tag, blank=True)
    visibility = models.IntegerField(choices=visibilityChoices)

    def __unicode__(self):
        return self.title
{'fraction_non_alphanumeric': 0.10074463425317565, 'fraction_numerical': 0.012264564169951819, 'mean_word_length': 3.14519056261343, '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': '7271184', 'n_tokens_mistral': 697, 'n_tokens_neox': 658, 'n_words': 207}