owner=models.ForeignKey(Researcher,verbose_name=Researcher._meta.verbose_name,on_delete=models.CASCADE,help_text=_('The researcher that is the owner this study. By default the researcher that has created this study.'))
name=models.CharField(_('Name'),max_length=200,help_text=_('Name of the research study.'))
description=models.TextField(_('Description'),blank=True,null=True,help_text=_('Enter a short description for this study.'))
owner=models.ForeignKey(Researcher,verbose_name=Researcher._meta.verbose_name,on_delete=models.CASCADE,help_text=_('The researcher that is the owner this study. By default the researcher that has created this study.'))
name=models.CharField(_('Name'),max_length=200,help_text=_('Name of the research study.'))
description=models.TextField(_('Description'),blank=True,null=True,help_text=_('Enter a short description for this study.'))
code=models.CharField(_('Code'),max_length=50,help_text=_('The research study code.'))
human_subject=models.BooleanField(_('Human subject'),help_text=_('Is this research study using real humans.'))
field=models.ForeignKey(StudyField,verbose_name=StudyField._meta.verbose_name,on_delete=models.CASCADE,help_text=_('The study field for this reaserch study.'))
code=models.CharField(_('Code'),max_length=50,help_text=_('The research study code.'))
human_subject=models.BooleanField(_('Human subject'),help_text=_('Is this research study using real humans.'))
field=models.ForeignKey(StudyField,verbose_name=StudyField._meta.verbose_name,on_delete=models.CASCADE,help_text=_('The study field for this reaserch study.'))
upload_code=models.CharField(_('Upload code'),max_length=20,default=get_random_int_value,editable=False,help_text=_('A unique upload code. Will be generated when a new study is saved.'))
upload_uuid=models.UUIDField(_('Upload url key'),unique=True,default=uuid.uuid4,editable=False,help_text=_('A unique upload url. Will be generated when a new study is saved.'))
upload_code=models.CharField(_('Upload code'),max_length=20,default=get_random_int_value,editable=False,help_text=_('A unique upload code. Will be generated when a new study is saved.'))
upload_uuid=models.UUIDField(_('Upload url key'),unique=True,default=uuid.uuid4,editable=False,help_text=_('A unique upload url. Will be generated when a new study is saved.'))
# Here we load our custom StudyManager so we always have the amount of files, total file size and amount of invitations directly accessable
objects=StudyManager()
objects=StudyManager()
@property
defhas_storage(self):
"""boolean: Returns true when there is at least one storage location connected to this study"""
#print(dir(self.storagelocation))
#print(dir(self.storagelocation))
returnself.storagelocationisnotNone
@property
defget_absolute_url(self):
"""str: Returns the full url to the study detail page."""
role=models.CharField(_('Role'),max_length=10,choices=StudyRoleNames.choices,default=StudyRoleNames.MEMBER,help_text=_('The role withing this research study.'))
role=models.CharField(_('Role'),max_length=10,choices=StudyRoleNames.choices,default=StudyRoleNames.MEMBER,help_text=_('The role withing this research study.'))
name=models.CharField(_('Name'),max_length=200,help_text=_('The name of the university.'))
email=models.EmailField(_('Email address'),max_length=200,help_text=_('The general email address for this university.'))
name=models.CharField(_('Name'),max_length=200,help_text=_('The name of the university.'))
email=models.EmailField(_('Email address'),max_length=200,help_text=_('The general email address for this university.'))
website=models.CharField(_('Website'),max_length=200,help_text=_('The full url to this university website.'))
def__str__(self):
@ -52,8 +54,8 @@ class Faculty(MetaDataModel):
verbose_name_plural=_('faculties')
ordering=['name']
name=models.CharField(_('Name'),max_length=200,help_text=_('The name of the faculty.'))
university=models.ForeignKey(University,verbose_name=University._meta.verbose_name,on_delete=models.CASCADE,help_text=_('To wich university belongs this faculty'))
name=models.CharField(_('Name'),max_length=200,help_text=_('The name of the faculty.'))
university=models.ForeignKey(University,verbose_name=University._meta.verbose_name,on_delete=models.CASCADE,help_text=_('To wich university belongs this faculty'))
def__str__(self):
"""str: Returns a readable string for the facutlty."""
@ -78,10 +80,9 @@ class StudyField(MetaDataModel):
verbose_name_plural=_('study fields')
ordering=['name']
name=models.CharField(_('Name'),max_length=200,help_text=_('The name of the study field.'))
name=models.CharField(_('Name'),max_length=200,help_text=_('The name of the study field.'))
faculty=models.ForeignKey(Faculty,verbose_name=Faculty._meta.verbose_name,on_delete=models.CASCADE,help_text=_('To wich faculty belongs this study'))
def__str__(self):
"""str: Returns a readable string for the studyfield."""