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

Merge branch 'master' of https://gitlab.pasteur.fr/odoppelt/iPPIDB

Former-commit-id: 672ba3d9883ae50b8f5b1246d72bc6933446132c
parents ccdb2917 1a815e2e
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,10 @@ from django import forms
from django.db import models
from .models import Bibliography, Protein, ProteinDomainComplex, Ppi, PpiComplex
class IdForm(forms.Form):
id = forms.CharField(label="",max_length=100, widget=forms.TextInput(attrs={'placeholder': 'PubMed ID / DOI / Patent ID'}))
class IdForm(ModelForm):
class Meta:
model = Bibliography
fields = ['source','id_source']
class BibliographyForm(ModelForm):
class Meta:
......
......@@ -288,6 +288,9 @@ class MDDRCompoundImport(models.Model):
unique_together = (('mddr_name', 'dvpmt_phase', 'canonical_smile'),)
verbose_name_plural = "MDDR compound imports"
def __str__(self):
return "{}, {}".format(self.mddr_name, self.dvpmt_phase)
class MDDRSimilarity(models.Model):
canonical_smile_ippidb = models.CharField('Canonical Smile for IPPIDB compound', max_length=500, unique=True, blank=True, null=True)
canonical_smile_mddr = models.CharField('Canonical Smile for MDDR Compound', max_length=500, unique=True, blank=True, null=True)
......
......@@ -38,7 +38,17 @@ TEMPLATES = {"IdForm": "IdForm.html",
class IppiWizard(SessionWizardView):
def get_template_names(self):
return [TEMPLATES[self.steps.current]]
def process_step(self, form):
"""
This method overrides the one used to postprocess the form data.
The added code just sets the form model for use in later forms
when appropriate
"""
if self.steps.current=='IdForm':
self.instance_dict['BibliographyForm'] = form.instance
return self.get_form_step_data(form)
def done(self, form_list, **kwargs):
return render(self.request, '/admin-session/add.html', {
'form_data': [form.cleaned_data for form in form_list],
......
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