25 lines
795 B
Python
25 lines
795 B
Python
from django import forms
|
|
|
|
from .models import ContactSubmission
|
|
|
|
|
|
class ContactForm(forms.ModelForm):
|
|
class Meta:
|
|
model = ContactSubmission
|
|
fields = ["name", "title", "description", "email"]
|
|
widgets = {
|
|
"name": forms.TextInput(
|
|
attrs={"placeholder": "Your full name", "autocomplete": "name"}
|
|
),
|
|
"title": forms.TextInput(attrs={"placeholder": "Subject / topic"}),
|
|
"description": forms.Textarea(
|
|
attrs={"placeholder": "Write your message here…", "rows": 5}
|
|
),
|
|
"email": forms.EmailInput(
|
|
attrs={
|
|
"placeholder": "your@email.com (optional)",
|
|
"autocomplete": "email",
|
|
}
|
|
),
|
|
}
|