<commit_before># -*- coding: utf-8 -*-

from datetime import datetime
from django.db import models


class Course(models.Model):
    """Course database schema"""
    no = models.CharField(max_length=20, blank=True)
    code = models.CharField(max_length=20, blank=True)
    eng_title = models.CharField(max_length=200, blank=True)
    chi_title = models.CharField(max_length=200, blank=True)
    note = models.TextField(blank=True)
    objective = models.CharField(max_length=80, blank=True)
    time = models.CharField(max_length=20, blank=True)
    time_token = models.CharField(max_length=20, blank=True)
    teacher = models.CharField(max_length=40, blank=True)  # Only save Chinese
    room = models.CharField(max_length=20, blank=True)
    credit = models.IntegerField(blank=True, null=True)
    limit = models.IntegerField(blank=True, null=True)
    prerequisite = models.BooleanField(default=False, blank=True)

    ge = models.CharField(max_length=80, blank=True)

    hit = models.IntegerField(default=0)

    syllabus = models.TextField(blank=True)  # pure text

    def __str__(self):
        return self.no


class Department(models.Model):
    dept_name = models.CharField(max_length=20, blank=True)
    required_course = models.ManyToManyField(Course, blank=True)

    def __unicode__(self):<commit_msg>update attachment attributes<commit_after># -*- coding: utf-8 -*-

from datetime import datetime
from django.db import models
from django.utils.http import urlquote

attachment_url_format = 'https://www.ccxp.nthu.edu.tw/ccxp/INQUIRE/JH/output/6_6.1_6.1.12/%s.pdf'  # noqa


class Course(models.Model):
    """Course database schema"""
    no = models.CharField(max_length=20, blank=True)
    code = models.CharField(max_length=20, blank=True)
    eng_title = models.CharField(max_length=200, blank=True)
    chi_title = models.CharField(max_length=200, blank=True)
    note = models.TextField(blank=True)
    objective = models.CharField(max_length=80, blank=True)
    time = models.CharField(max_length=20, blank=True)
    time_token = models.CharField(max_length=20, blank=True)
    teacher = models.CharField(max_length=40, blank=True)  # Only save Chinese
    room = models.CharField(max_length=20, blank=True)
    credit = models.IntegerField(blank=True, null=True)
    limit = models.IntegerField(blank=True, null=True)
    prerequisite = models.BooleanField(default=False, blank=True)

    ge = models.CharField(max_length=80, blank=True)

    hit = models.IntegerField(default=0)

    syllabus = models.TextField(blank=True)  # pure text
    has_attachment = models.BooleanField(default=False)  # has pdf

    def __str__(self):
        return self.no

    @property
    def attachment_url(self):
        return attachment_url_format % urlquote(self.no)


class Department(models.Model):
    dept_name = models.CharField(max_length=20, blank=True)
    required_course = models.ManyToManyField(Course, blank=True)

    def __unicode__(self):
{'fraction_non_alphanumeric': 0.11732973701955496, 'fraction_numerical': 0.019892110586648686, 'mean_word_length': 4.566604127579738, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '5177559', 'n_tokens_mistral': 998, 'n_tokens_neox': 950, 'n_words': 178}