mirror of
https://github.com/thecyberlearn/hostinger-django-demo.git
synced 2026-08-18 23:53:02 +00:00
🎉 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
27 lines
844 B
Python
27 lines
844 B
Python
from django import forms
|
|
from .models import Contact
|
|
|
|
|
|
class ContactForm(forms.ModelForm):
|
|
class Meta:
|
|
model = Contact
|
|
fields = ['name', 'email', 'subject', 'message']
|
|
widgets = {
|
|
'name': forms.TextInput(attrs={
|
|
'class': 'form-control',
|
|
'placeholder': 'Your Name'
|
|
}),
|
|
'email': forms.EmailInput(attrs={
|
|
'class': 'form-control',
|
|
'placeholder': 'your.email@example.com'
|
|
}),
|
|
'subject': forms.TextInput(attrs={
|
|
'class': 'form-control',
|
|
'placeholder': 'Subject'
|
|
}),
|
|
'message': forms.Textarea(attrs={
|
|
'class': 'form-control',
|
|
'rows': 5,
|
|
'placeholder': 'Your message...'
|
|
}),
|
|
} |