Skip to content

Commit

Permalink
Add help text to model fields
Browse files Browse the repository at this point in the history
  • Loading branch information
neoformit committed Dec 8, 2023
1 parent 8c5ab7a commit b51c2ab
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Generated by Django 4.2 on 2023-12-08 00:23

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('tracks', '0012_alter_genome_ncbi_bioproject'),
]

operations = [
migrations.AlterField(
model_name='genome',
name='_metadata_yaml',
field=models.TextField(blank=True, help_text='Metadata in YAML format. Should be one `key: value` pair per line.', null=True),
),
migrations.AlterField(
model_name='genome',
name='apollo_url',
field=models.URLField(blank=True, help_text='URL pointing to a public Apollo genome/tracks.', null=True),
),
migrations.AlterField(
model_name='genome',
name='condition',
field=models.CharField(blank=True, help_text='e.g. chemical exposure, genetic manipulation, cancer.', max_length=255, null=True),
),
migrations.AlterField(
model_name='genome',
name='description_html',
field=models.TextField(blank=True, help_text='Description of the genome with inline HTML. Use `<br>` for a new line and `<a>` tags for links.', null=True),
),
migrations.AlterField(
model_name='lab',
name='apollo_url',
field=models.URLField(blank=True, help_text='URL pointing to an Apollo login page.', null=True),
),
migrations.AlterField(
model_name='lab',
name='description_html',
field=models.TextField(blank=True, help_text='Description of the genome with inline HTML. Use `<br>` for a new line and `<a>` tags for links.', null=True),
),
migrations.AlterField(
model_name='lab',
name='email',
field=models.EmailField(blank=True, help_text='Contact email address, if consent has been given to show.', max_length=254, null=True),
),
migrations.AlterField(
model_name='lab',
name='website_url',
field=models.URLField(blank=True, help_text='URL pointing to lab group public website.', null=True),
),
]
35 changes: 27 additions & 8 deletions apollo_portal/tracks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,21 @@ class Lab(models.Model):
name = models.CharField(max_length=255)
datetime_created = models.DateTimeField(auto_now_add=True)
datetime_modified = models.DateTimeField(auto_now=True)
description_html = models.TextField(null=True, blank=True)
website_url = models.URLField(null=True, blank=True)
apollo_url = models.URLField(null=True, blank=True)
description_html = models.TextField(null=True, blank=True, help_text=(
"Description of the genome with inline HTML. Use `<br>` for a new line"
" and `<a>` tags for links."
))
website_url = models.URLField(null=True, blank=True, help_text=(
"URL pointing to lab group public website."
))
apollo_url = models.URLField(null=True, blank=True, help_text=(
"URL pointing to an Apollo login page."
))
principle_investigator = models.CharField(
max_length=255, null=True, blank=True)
email = models.EmailField(null=True, blank=True)
email = models.EmailField(null=True, blank=True, help_text=(
"Contact email address, if consent has been given to show."
))
image = models.ImageField(null=True, blank=True, upload_to="labs")

def __str__(self):
Expand Down Expand Up @@ -73,14 +82,24 @@ class Genome(models.Model):
name = models.CharField(max_length=255)
species = models.CharField(max_length=255)
strain = models.CharField(max_length=255, null=True, blank=True)
condition = models.CharField(max_length=255, null=True, blank=True)
condition = models.CharField(
max_length=255, null=True, blank=True, help_text=(
"e.g. chemical exposure, genetic manipulation, cancer."
))
thumbnail = models.ImageField(null=True, blank=True, upload_to="genomes")
apollo_url = models.URLField(null=True, blank=True)
description_html = models.TextField(null=True, blank=True)
apollo_url = models.URLField(null=True, blank=True, help_text=(
"URL pointing to a public Apollo genome/tracks."
))
description_html = models.TextField(null=True, blank=True, help_text=(
"Description of the genome with inline HTML. Use `<br>` for a new line"
" and `<a>` tags for links."
))
reference = models.TextField(null=True, blank=True)
doi = models.CharField(max_length=255, null=True, blank=True)
ncbi_bioproject = models.CharField(max_length=12, null=True, blank=True)
_metadata_yaml = models.TextField(null=True, blank=True)
_metadata_yaml = models.TextField(null=True, blank=True, help_text=(
"Metadata in YAML format. Should be one `key: value` pair per line."
))

def __str__(self):
"""Return string representation."""
Expand Down

0 comments on commit b51c2ab

Please sign in to comment.