38165-vm/core/forms.py
Flatlogic Bot 6f1ed9a2fa Finish 1.0
2026-02-04 03:45:28 +00:00

15 lines
830 B
Python

from django import forms
from .models import Item, Category
class ItemForm(forms.ModelForm):
class Meta:
model = Item
fields = ['name', 'category', 'image', 'item_type', 'tags']
widgets = {
'name': forms.TextInput(attrs={'class': 'form-control bg-dark text-white border-secondary', 'placeholder': 'Item Name'}),
'category': forms.Select(attrs={'class': 'form-select bg-dark text-white border-secondary'}),
'item_type': forms.Select(attrs={'class': 'form-select bg-dark text-white border-secondary'}),
'tags': forms.TextInput(attrs={'class': 'form-control bg-dark text-white border-secondary', 'placeholder': 'Tags (comma-separated)'}),
'image': forms.FileInput(attrs={'class': 'form-control bg-dark text-white border-secondary'}),
}