Skip to content
Snippets Groups Projects
Commit 149988fe authored by Rachel TORCHET's avatar Rachel TORCHET
Browse files

tiny changes in form text placeholder

Former-commit-id: 05e17f3c7cfc33c143b0dbea1feab83240b12b17
parent 09964a24
No related branches found
No related tags found
No related merge requests found
...@@ -7,19 +7,28 @@ class IdForm(ModelForm): ...@@ -7,19 +7,28 @@ class IdForm(ModelForm):
class Meta: class Meta:
model = Bibliography model = Bibliography
fields = ['source','id_source'] fields = ['source','id_source']
widgets = {
'source' : forms.RadioSelect,
'id_source': forms.TextInput(attrs={'placeholder': 'PubMed ID / DOI / Patent ID'}),
}
class BibliographyForm(ModelForm): class BibliographyForm(ModelForm):
class Meta: class Meta:
model = Bibliography model = Bibliography
exclude = ['title','journal_name', 'authors_list', 'biblio_year'] exclude = ['authors_list', 'biblio_year']
class PDBForm(forms.Form): class PDBForm(forms.Form):
pdb_id = forms.CharField(label="PDB ID",max_length=100, widget=forms.TextInput(attrs={'placeholder': '123456'})) pdb_id = forms.CharField(label="PDB ID",max_length=100, widget=forms.TextInput(attrs={'placeholder': 'e.g 4HHB'}))
class ProteinForm(ModelForm): class ProteinForm(ModelForm):
class Meta: class Meta:
model = Protein model = Protein
exclude = ['recommended_name_long', 'short_name'] exclude = ['recommended_name_long', 'short_name']
widgets = {
'uniprot_id' : forms.TextInput(attrs={'placeholder': 'e.g Q03164'}),
'gene_name' : forms.TextInput(attrs={'placeholder':'e.g KMT2A'}),
'entry_name' : forms.TextInput(attrs={'placeholder':'e.g KMT2A_HUMAN'}),
}
ARCHI_TYPE = ( ARCHI_TYPE = (
...@@ -51,13 +60,13 @@ class ProteinDomainComplexTypeForm(forms.Form): ...@@ -51,13 +60,13 @@ class ProteinDomainComplexTypeForm(forms.Form):
widget=forms.Select( widget=forms.Select(
choices=ARCHI_TYPE) choices=ARCHI_TYPE)
) )
inhibited = forms.MultipleChoiceField( inhibited = forms.ChoiceField(
widget=forms.CheckboxSelectMultiple, widget=forms.RadioSelect,
choices=INHIBITED_CHOICES, choices=INHIBITED_CHOICES,
) )
stabilized = forms.MultipleChoiceField( stabilized = forms.ChoiceField(
widget=forms.CheckboxSelectMultiple, widget=forms.RadioSelect,
choices=STABILIZED_CHOICES, choices=STABILIZED_CHOICES,
) )
......
...@@ -9,8 +9,9 @@ class Bibliography(models.Model): ...@@ -9,8 +9,9 @@ class Bibliography(models.Model):
Bibliography data table Bibliography data table
""" """
SOURCES = ( SOURCES = (
('PM', 'PubMed article'), ('PM', 'PubMed ID'),
('PT', 'Patent') ('PT', 'Patent'),
('DO', 'DOI ID')
) )
source = models.CharField('Bibliographic type', max_length=2, choices=SOURCES) source = models.CharField('Bibliographic type', max_length=2, choices=SOURCES)
id_source = models.CharField('Bibliographic ID', max_length=25) id_source = models.CharField('Bibliographic ID', max_length=25)
...@@ -77,7 +78,7 @@ class Protein(models.Model): ...@@ -77,7 +78,7 @@ class Protein(models.Model):
short_name = models.CharField('Short name', max_length=50) short_name = models.CharField('Short name', max_length=50)
gene_name = models.CharField('Gene name', unique=True, max_length=30) gene_name = models.CharField('Gene name', unique=True, max_length=30)
entry_name = models.CharField('Entry name', max_length=30) entry_name = models.CharField('Entry name', max_length=30)
organism = models.ForeignKey('Taxonomy') organism = models.ForeignKey('Taxonomy', default='Homo sapiens')
molecular_functions = models.ManyToManyField(MolecularFunction) molecular_functions = models.ManyToManyField(MolecularFunction)
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment