Add form for submitting image URL

This commit is contained in:
Oliver Walters 2021-03-17 08:28:12 +11:00
parent 6946abae13
commit 3900f9b1b6

View File

@ -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 """