devicehub-django/action/forms.py

17 lines
536 B
Python
Raw Normal View History

2024-12-06 20:48:06 +00:00
from django import forms
from .models import State
2024-12-19 21:17:09 +00:00
class ChangeStateForm(forms.Form):
previous_state = forms.CharField(widget=forms.HiddenInput())
snapshot_uuid = forms.UUIDField(widget=forms.HiddenInput())
new_state = forms.CharField(widget=forms.HiddenInput())
class AddNoteForm(forms.Form):
snapshot_uuid = forms.UUIDField(widget=forms.HiddenInput())
2024-12-06 20:48:06 +00:00
note = forms.CharField(
2024-12-19 21:17:09 +00:00
required=True,
2024-12-06 20:48:06 +00:00
widget=forms.Textarea(attrs={'rows': 4, 'maxlength': 200, 'placeholder': 'Max 200 characters'}),
)