<commit_before>from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils.fields import StatusField
from model_utils import Choices
from model_utils.models import TimeStampedModel
from django.contrib.auth.models import User

class ClassRoom(TimeStampedModel):
    """ ClassRoom
    """
    STATUS = Choices('draft', 'active', 'closed')

    name =  models.CharField(_('name'), max_length=255, blank=True)
    tutor = models.ForeignKey(User, verbose_name=_('tutor'))
    description = models.TextField(blank=True, null=True, default="")
    status = StatusField(default=STATUS.draft)
    
    
    @property
    def steps(self):
        return self.step_set.all()<commit_msg>Added is_active and is_tutor methods to classroom model<commit_after>from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils.fields import StatusField
from model_utils import Choices
from model_utils.models import TimeStampedModel
from django.contrib.auth.models import User

class ClassRoom(TimeStampedModel):
    """ ClassRoom
    """
    STATUS = Choices('draft', 'active', 'closed')

    name =  models.CharField(_('name'), max_length=255, blank=True)
    tutor = models.ForeignKey(User, verbose_name=_('tutor'))
    description = models.TextField(blank=True, null=True, default="")
    status = StatusField(default=STATUS.draft)

    @property
    def steps(self):
        return self.step_set.all()

    def is_active(self):
        return True if self.status == "active" else False

    def is_tutor(self, user):
        if user == self.tutor:
            return True
        return False
{'fraction_non_alphanumeric': 0.10253317249698432, 'fraction_numerical': 0.0036188178528347406, 'mean_word_length': 4.12037037037037, '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': '3922406', 'n_tokens_mistral': 492, 'n_tokens_neox': 475, 'n_words': 125}