PageRenderTime 21ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/main/forms.py

https://gitlab.com/wedava/DereksAuto
Python | 18 lines | 11 code | 7 blank | 0 comment | 0 complexity | 3446d3616f1e7881f04d2f3a40eb7b01 MD5 | raw file
 1from django import forms
 2from .models import Item
 3
 4
 5class ItemForm(forms.ModelForm):
 6    image_link = forms.URLField(widget=forms.FileInput(), label="Image(250x250)")
 7
 8    class Meta:
 9        model = Item
10        fields = ['title', 'manufacturer', 'price', 'initial_price', 'shipping', 'amazon_url', 'image_link']
11
12
13class ItemUpdateForm(forms.ModelForm):
14
15    class Meta:
16        model = Item
17        fields = ['title', 'manufacturer', 'price', 'initial_price', 'shipping', 'amazon_url', 'image_link']
18