from django import forms from .models import Submission class CodeForm(forms.Form): code = forms.CharField(max_length=14, widget=forms.TextInput(attrs={'placeholder': 'xxx-xxx-xxx', 'inputmode': 'numeric'})) passphrase = forms.CharField(max_length=32) class SubmissionForm(forms.ModelForm): method = forms.ChoiceField(choices=( ('upload', 'I need to upload a file'), ('link', 'I have a link from my own cloud storage provider') ), initial='upload') class Meta: model = Submission fields = ['name', 'instrument', 'method', 'notes']