chore: restructured project

This commit is contained in:
ITQ
2025-03-07 19:32:09 +03:00
parent bfb7ad901a
commit 0a35951c62
178 changed files with 304 additions and 376 deletions
+35
View File
@@ -0,0 +1,35 @@
from typing import Any
from django import forms
from apps.campaign.models import Campaign, CampaignReport
class CampaignForm(forms.ModelForm):
class Meta:
model = Campaign
fields = "__all__"
def clean(self) -> dict[str, Any]:
cleaned_data = super().clean()
location = cleaned_data.get("location")
if location == "":
cleaned_data["location"] = None
return cleaned_data
class CampaignReportForm(forms.ModelForm):
class Meta:
model = CampaignReport
fields = "__all__"
def clean(self) -> dict[str, Any]:
cleaned_data = super().clean()
message = cleaned_data.get("message")
if message == "":
cleaned_data["message"] = None
return cleaned_data