-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from carlosp420/dataset_form_inheritance
Dataset form inheritance, docs and setup.py
- Loading branch information
Showing
7 changed files
with
56 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Django==1.7.3 | ||
biopython==1.65 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
try: | ||
from setuptools import setup | ||
except ImportError: | ||
from distutils.core import setup | ||
|
||
import voseq | ||
|
||
version = voseq.__version__ | ||
|
||
setup( | ||
name='VoSeq', | ||
version=version, | ||
author='Carlos Pena, Tobias Malm, Victor Mezarino', | ||
author_email='carlosp420@gmail.com', | ||
packages=[ | ||
'voseq', | ||
], | ||
include_package_data=True, | ||
install_requires=[ | ||
'Django==1.7.3', | ||
], | ||
zip_safe=False, | ||
scripts=['voseq/manage.py'], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,6 @@ | ||
from django import forms | ||
from core.forms import BaseDatasetForm | ||
|
||
from public_interface.models import Genes | ||
from public_interface.models import GeneSets | ||
from public_interface.models import TaxonSets | ||
|
||
|
||
class GenBankFastaForm(forms.Form): | ||
taxonset = forms.ModelChoiceField( | ||
TaxonSets.objects.all(), | ||
label='Choose taxonset', | ||
required=False, | ||
empty_label='Choose taxonset', | ||
) | ||
geneset = forms.ModelChoiceField( | ||
GeneSets.objects.all(), | ||
label='Choose geneset', | ||
required=False, | ||
empty_label='Choose geneset', | ||
) | ||
gene_codes = forms.ModelMultipleChoiceField( | ||
Genes.objects.all(), | ||
label='Check to select your alignment/gene', | ||
required=False, | ||
widget=forms.CheckboxSelectMultiple(), | ||
) | ||
voucher_codes = forms.CharField( | ||
widget=forms.Textarea, | ||
label='... and/or a list of voucher codes', | ||
required=False, | ||
) | ||
|
||
def clean(self): | ||
"""Overwriting validator method of class form.""" | ||
cleaned_data = super(GenBankFastaForm, self).clean() | ||
taxonset = cleaned_data.get("taxonset") | ||
voucher_codes = cleaned_data.get("voucher_codes") | ||
|
||
geneset = cleaned_data.get("geneset") | ||
gene_codes = cleaned_data.get("gene_codes") | ||
print(gene_codes) | ||
|
||
if taxonset is None and voucher_codes.strip() == '': | ||
raise forms.ValidationError("You need to enter at least some " | ||
"voucher codes or select a taxonset.") | ||
|
||
if geneset is None and len(gene_codes) < 1: | ||
raise forms.ValidationError("You need to enter at least some " | ||
"gene codes or select a geneset.") | ||
class GenBankFastaForm(BaseDatasetForm): | ||
"""The methods needed by this class are very basic.""" | ||
pass |