from django import forms
from .models import MoodEntry, Activity

class MoodEntryForm(forms.ModelForm):
    activities = forms.ModelMultipleChoiceField(
        queryset=Activity.objects.all(),
        widget=forms.CheckboxSelectMultiple,
        required=False
    )

    class Meta:
        model = MoodEntry
        fields = ['mood_score', 'note', 'activities']
        widgets = {
            'mood_score': forms.NumberInput(attrs={'min': 1, 'max': 5}),
            'note': forms.Textarea(attrs={'rows': 4}),
        }
