labelbase/importer/forms.py
Xavier Fiechter 261e285001 .
2023-02-09 18:52:20 +01:00

17 lines
537 B
Python

from django import forms
IMPORT_CHOICES = (
('BIP-0329', 'BIP-0329'),
('csv-bluewallet', 'BlueWallet .csv'),
)
class UploadFileForm(forms.Form):
labelbase_id = forms.IntegerField()
import_type = forms.ChoiceField(choices = IMPORT_CHOICES, widget = forms.HiddenInput())
file = forms.FileField()
def __init__(self, *args, **kwargs):
self.format = kwargs.pop('format')
super(UploadFileForm, self).__init__(*args, **kwargs)
self.fields['labelbase_id'].initial = kwargs.pop('labelbase_id')