<commit_before>from django.db import models
from django.conf import settings

# grab defaults from settings file
try:
    COURSE_LEVELS = settings.COURSE_LEVELS
except:
    COURSE_LEVELS = (
            ('L', _('Lower Division')),
            ('U', _('Upper Division')),
            ('G', _('Graduate')),
        )
    
class Course(models.Model):
    """*Courses*

    Each unique course# and course title.
    This model is used to make it easier to search and enter couses
    for the many different Models that use them.
    """

    department = models.ForeignKey(Department, verbose_name=_("Department"))
    level = models.CharField(_("Level"), max_length=4, choices=COURSE_LEVELS)
    credits = models.PositiveSmallIntegerField(_("Number of Credits"))
    number = models.PositiveSmallIntegerField(_("Course Number"), db_index=True)
    extra_number = models.CharField(_("Extra Course Number"), max_length=25)
    title = models.CharField(_("Course Title"), max_length=255)

    def __unicode__(self):
        return u"%s %i%i%s" % (self.department, self.credits, 
                               self.number, self.extra_number)

    def short_title(self):
        """Returns a truncated title useful for table displays and menus."""
        title =  u"%s: %s" % (unicode(self), self.title)
        return title[:22]
    
    class Meta:
        ordering = ('number', 'title')
        unique_together = ('department', 'number', 'extra_number', 'title')

    class Admin:
        list_display = ('__unicode__', 'level', 'last_update')
        search_fields = ('number', 'title')
        list_filter = ['level']
        list_per_page = 400  <commit_msg>Added stub for CourseOffering<commit_after>from django.db import models
from django.conf import settings

# grab defaults from settings file
try:
    COURSE_LEVELS = settings.COURSE_LEVELS
except:
    COURSE_LEVELS = (
            ('L', _('Lower Division')),
            ('U', _('Upper Division')),
            ('G', _('Graduate')),
        )
    
class Course(models.Model):
    """*Courses*

    Each unique course# and course title.
    This model is used to make it easier to search and enter couses
    for the many different Models that use them.
    """

    department = models.ForeignKey(Department, verbose_name=_("Department"))
    level = models.CharField(_("Level"), max_length=4, choices=COURSE_LEVELS)
    credits = models.PositiveSmallIntegerField(_("Number of Credits"))
    pre_number = models.CharField(_("Pre Course Number"), max_length=25, blank=True)
    number = models.PositiveSmallIntegerField(_("Course Number"), db_index=True)
    post_number = models.CharField(_("Extra Course Number"), max_length=25,
        blank=True)
    title = models.CharField(_("Course Title"), max_length=255)

    def __unicode__(self):
        return u"%s %s%i%i%s" % (self.department.abbr, self.credits, 
            self.pre_number, self.number, self.post_number)

    def short_title(self):
        """Returns a truncated title useful for table displays and menus."""
        title =  u"%s: %s" % (unicode(self), self.title)
        return title[:22]
    
    class Meta:
        ordering = ('number', 'pre_number', 'post_number', 'title')
        unique_together = ('department', 'pre_number', 'number', 'post_number', 'title')

    class Admin:
        list_display = ('__unicode__', 'level', 'last_update')
        list_filter = ['level']
        list_per_page = 400

class CourseOffering(models.Model):
    """Course Offering.
    
    Time/Professor/Meets with information
    """
    
{'fraction_non_alphanumeric': 0.12819791959516447, 'fraction_numerical': 0.0067472589260612875, 'mean_word_length': 3.15169194865811, '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': '1044565', 'n_tokens_mistral': 1090, 'n_tokens_neox': 1034, 'n_words': 280}