<commit_before>from __future__ import unicode_literals
from common.models import BaseModel
from .choices import CAT_CHOICES, MGMT_CHOICES, MT_CHOICES, SEX_CHOICES
from django.contrib.gis.db import models


class Assessment(BaseModel):
    id = models.IntegerField(primary_key=True)
    name = models.CharField(max_length=300)
    programme = models.ForeignKey('Programme', db_column='pid', blank=True,
                                  null=True, on_delete=models.SET_NULL)
    start = models.DateField(blank=True, null=True)
    end = models.DateField(blank=True, null=True)

    def __unicode__(self):
        return self.name

    class Meta:
        managed = False
        db_table = 'tb_assessment'


<<<<<<< HEAD
class InstitutionAssessmentCohorts(BaseModel):
=======
# class InstitutionAgg(BaseModel):
#     school = models.ForeignKey('School', db_column='id', primary_key=True)
#     name = models.CharField(max_length=300, blank=True)
#     bid = models.ForeignKey("Boundary", db_column='bid', blank=True, null=True, on_delete=models.SET_NULL)
#     sex = models.CharField(max_length=128, choices=SEX_CHOICES)
#     mt = models.CharField(max_length=128, choices=MT_CHOICES)
#     num = models.IntegerField(blank=True, null=True)

#     def __unicode__(self):
#         return self.name

#     class Meta:
#         managed = False
#         db_table = 'tb_institution_agg'

class InstitutionAgg(BaseModel):
    id = models.CharField(max_length=20, primary_key=True)
    academic_year = models.ForeignKey('AcademicYear')
    school = models.ForeignKey('School')
    boundary = models.ForeignKey("Boundary", blank=True, null=True, on_delete=models.SET_NULL)
    gender = models.CharField(max_length=128, choices=SEX_CHOICES)
    mt = models.CharField(max_length=128, choices=MT_CHOICES)
    num = models.IntegerField(blank=True, null=True)

    def __unicode__(self):
        return self.id

    class Meta:
        managed = False
        db_table = 'mvw_institution_aggregations'


class InstitutionAggregation(BaseModel):
    school = models.ForeignKey('School')
    academic_year = models.ForeignKey(
        'AcademicYear',
        blank=True, null=True, default=102, on_delete=models.SET_NULL
    )

    name = models.CharField(max_length=300, blank=True)
    boundary = models.ForeignKey(
        "Boundary", blank=True, null=True, on_delete=models.SET_NULL
    )
    sex = models.CharField(max_length=128, choices=SEX_CHOICES)
    mt = models.CharField(max_length=128, choices=MT_CHOICES)
    num = models.IntegerField(blank=True, null=True)

    def __unicode__(self):
        return self.name


class InstitutionAssessmentAgg(BaseModel):
>>>>>>> develop
    school = models.ForeignKey('School', db_column='sid', primary_key=True)
    assessment = models.ForeignKey('Assessment', db_column='assid',
                                   blank=True, null=True, on_delete=models.SET_NULL)
    studentgroup = models.CharField(max_length=50, blank=True)
    sex = models.CharField(max_length=128, choices=SEX_CHOICES)
    mt = models.CharField(max_length=128, choices=MT_CHOICES)
    cohortsnum= models.IntegerField()

    def __unicode__(self):
<<<<<<< HEAD
        return "%s: %s: %s: %s" % (self.school,self.assessment, self.sex, self.mt,)
=======
        return "%s: %s: %s" % (self.school, self.sex, self.mt,)

    class Meta:
        managed = False
        db_table = 'tb_institution_assessment_agg'


class InstitutionAssessmentAggCohorts(BaseModel):
    school = models.ForeignKey('School', db_column='sid', primary_key=True)
    assessment = models.ForeignKey(
        'Assessment', db_column='assid',
        blank=True, null=True, on_delete=models.SET_NULL)

    studentgroup = models.CharField(max_length=50, blank=True)
    sex = models.CharField(max_length=128, choices=SEX_CHOICES)
    mt = models.CharField(max_length=128, choices=MT_CHOICES)
    domain = models.CharField(max_length=100, blank=True)
    domain_order = models.IntegerField(blank=True, null=True)
    aggtext = models.CharField(max_length=100)
    aggtext_order = models.IntegerField()
    cohortsval = models.DecimalField(max_digits=6, decimal_places=2,
                                     blank=True, null=True)

    def __unicode__(self):
        return "%s: %s: %s" % (self.school, self.sex, self.mt,)
>>>>>>> develop

    class Meta:

        #workaround for https://code.djangoproject.com/ticket/8162
        verbose_name = 'InstAssAggCohorts'
        managed = False
        db_table = 'tb_institution_assessment_cohorts'


class InstitutionAssessmentSinglescore(BaseModel):
    school = models.ForeignKey('School', db_column='sid', primary_key=True)
    assessment = models.ForeignKey('Assessment', db_column='assid')
    studentgroup = models.CharField(max_length=50, blank=True)
    singlescore = models.DecimalField(max_digits=6, decimal_places=2,
                                      blank=True, null=True)
    percentile= models.DecimalField(max_digits=6, decimal_places=2,
                                      blank=True, null=True)

    def __unicode__(self):<commit_msg>oops, forgot to add file<commit_after>from __future__ import unicode_literals
from common.models import BaseModel
from .choices import CAT_CHOICES, MGMT_CHOICES, MT_CHOICES, SEX_CHOICES
from django.contrib.gis.db import models


class Assessment(BaseModel):
    id = models.IntegerField(primary_key=True)
    name = models.CharField(max_length=300)
    programme = models.ForeignKey('Programme', db_column='pid', blank=True,
                                  null=True, on_delete=models.SET_NULL)
    start = models.DateField(blank=True, null=True)
    end = models.DateField(blank=True, null=True)

    def __unicode__(self):
        return self.name

    class Meta:
        managed = False
        db_table = 'tb_assessment'


class InstitutionAssessmentCohorts(BaseModel):
    school = models.ForeignKey('School', db_column='sid', primary_key=True)
    assessment = models.ForeignKey('Assessment', db_column='assid',
                                   blank=True, null=True, on_delete=models.SET_NULL)
    studentgroup = models.CharField(max_length=50, blank=True)
    sex = models.CharField(max_length=128, choices=SEX_CHOICES)
    mt = models.CharField(max_length=128, choices=MT_CHOICES)
    cohortsnum= models.IntegerField()

    def __unicode__(self):
        return "%s: %s: %s: %s" % (self.school,self.assessment, self.sex, self.mt,)

    class Meta:

        #workaround for https://code.djangoproject.com/ticket/8162
        verbose_name = 'InstAssAggCohorts'
        managed = False
        db_table = 'tb_institution_assessment_cohorts'


class InstitutionAssessmentSinglescore(BaseModel):
    school = models.ForeignKey('School', db_column='sid', primary_key=True)
    assessment = models.ForeignKey('Assessment', db_column='assid')
    studentgroup = models.CharField(max_length=50, blank=True)
    singlescore = models.DecimalField(max_digits=6, decimal_places=2,
                                      blank=True, null=True)
    percentile= models.DecimalField(max_digits=6, decimal_places=2,
                                      blank=True, null=True)

    def __unicode__(self):
{'fraction_non_alphanumeric': 0.11446873694471522, 'fraction_numerical': 0.01211530427517059, 'mean_word_length': 3.6186495176848874, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3378500', 'n_tokens_mistral': 2372, 'n_tokens_neox': 2207, 'n_words': 398}