From 3900f9b1b64181acb898bfb94b8cb8cea505d354 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 17 Mar 2021 08:28:12 +1100 Subject: [PATCH] Add form for submitting image URL --- InvenTree/part/forms.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/InvenTree/part/forms.py b/InvenTree/part/forms.py index 85a851e235..7962ec3252 100644 --- a/InvenTree/part/forms.py +++ b/InvenTree/part/forms.py @@ -37,6 +37,24 @@ class PartModelChoiceField(forms.ModelChoiceField): return label +class PartImageDownloadForm(HelperForm): + """ + Form for downloading an image from a URL + """ + + url = forms.URLField( + label=_('URL'), + help_text=_('Image URL'), + required=True, + ) + + class Meta: + model = Part + fields = [ + 'url', + ] + + class PartImageForm(HelperForm): """ Form for uploading a Part image """