<commit_before>from django.utils import timezone
from approver.models import Project, ClinicalArea, ClinicalSetting, Person, BigAim, Descriptor
from django.contrib.auth.models import User
from approver import utils

class ProjectForm():

    def __init__(self, project=Project(),is_disabled=False):
        start_date = project.proposed_start_date or timezone.now()
        end_date = project.proposed_end_date or timezone.now()

        self.is_disabled = is_disabled

        self.title = {'name': 'title',
                      'type': 'text',
                      'rows': 2,
                      'placeholder': 'Full project title goes here',
                      'required': True,
                      'value': project.title or ''}

        self.collaborator = {'name': 'collaborator',
                             'model': 'person',
                             'placeholder': 'e.g. <NAME>',
                             'label': 'Type collaborator name, then press "enter" to save',
                             'filter_field': ';'.join(['email_address','first_name', 'last_name']),
                             'tag_prop': Person.tag_property_name,
                             'selected': utils.get_related_property(project, "collaborator", 'email_address')}

        self.advisor = {'name': 'advisor',
                        'model': 'person',
                        'placeholder': 'e.g. <NAME>',
                        'label': 'Type advisor name, then press "enter" to save',
                        'filter_field': ';'.join(['email_address','first_name', 'last_name']),
                        'tag_prop': Person.tag_property_name,
                        'selected': utils.get_related_property(project, "advisor", 'email_address')}

        self.mesh_keyword = {'name': 'mesh_keyword',
                             'label': 'MeSH Keywords',
                             'model': 'descriptor',
                             'filter_field': 'mesh_heading',
                             'tag_prop': Descriptor.tag_property_name,
                             'selected': utils.get_related_property(project, "mesh_keyword", "mesh_heading")}

        self.bigaim = {'name': 'big_aim',
                       'label': 'Please select from the dropdown the UF Health Big Aims relating to your project',
                       'placeholder': 'UF Health Big Aim',
                       'selected': getattr(project.big_aim,'name',''),
                       'options':  BigAim.objects.values_list('name', flat=True).order_by('sort_order'),
                       'input_class_list': ''}

        self.clinical_area = {'name': 'clinical_area',
                              'label': 'OPTIONAL: What is the Clinical Area/Unit of your project? Type clinical area, then press "enter" to save',
                              'model': 'clinicalarea',<commit_msg>Update MeSH keywords with proper label and placeholder text<commit_after>from django.utils import timezone
from approver.models import Project, ClinicalArea, ClinicalSetting, Person, BigAim, Descriptor
from django.contrib.auth.models import User
from approver import utils

class ProjectForm():

    def __init__(self, project=Project(),is_disabled=False):
        start_date = project.proposed_start_date or timezone.now()
        end_date = project.proposed_end_date or timezone.now()

        self.is_disabled = is_disabled

        self.title = {'name': 'title',
                      'type': 'text',
                      'rows': 2,
                      'placeholder': 'Full project title goes here',
                      'required': True,
                      'value': project.title or ''}

        self.collaborator = {'name': 'collaborator',
                             'model': 'person',
                             'placeholder': 'e.g. Alligator, Albert',
                             'label': 'Type collaborator name, then press "enter" to save',
                             'filter_field': ';'.join(['email_address','first_name', 'last_name']),
                             'tag_prop': Person.tag_property_name,
                             'selected': utils.get_related_property(project, "collaborator", 'email_address')}

        self.advisor = {'name': 'advisor',
                        'model': 'person',
                        'placeholder': 'e.g. Alligator, Alberta',
                        'label': 'Type advisor name, then press "enter" to save',
                        'filter_field': ';'.join(['email_address','first_name', 'last_name']),
                        'tag_prop': Person.tag_property_name,
                        'selected': utils.get_related_property(project, "advisor", 'email_address')}

        self.mesh_keyword = {'name': 'mesh_keyword',
                             'label': 'Please indicate 5 or more MeSH keywords relating to your project. Type keyword, then press "enter" to save',
                             'model': 'descriptor',
                             'filter_field': 'mesh_heading',
                             'placeholder': 'e.g. Micronutrient and/or Zinc',
                             'tag_prop': Descriptor.tag_property_name,
                             'selected': utils.get_related_property(project, "mesh_keyword", "mesh_heading"),
                             'div_classes': 'about__txtfield--100',}

        self.bigaim = {'name': 'big_aim',
                       'label': 'Please select from the dropdown the UF Health Big Aims relating to your project',
                       'placeholder': 'UF Health Big Aim',
                       'selected': getattr(project.big_aim,'name',''),
                       'options':  BigAim.objects.values_list('name', flat=True).order_by('sort_order'),
                       'input_class_list': ''}

        self.clinical_area = {'name': 'clinical_area',
                              'label': 'OPTIONAL: What is the Clinical Area/Unit of your project? Type clinical area, then press "enter" to save',
                              'model': 'clinicalarea',
{'fraction_non_alphanumeric': 0.1179003146216261, 'fraction_numerical': 0.0009935419771485345, 'mean_word_length': 1.742960944595822, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4929548', 'n_tokens_mistral': 1540, 'n_tokens_neox': 1475, 'n_words': 380}