update the lead make and model select qs

This commit is contained in:
ismail 2025-08-28 13:27:47 +03:00
parent a697d00dd1
commit 11a120879e
7 changed files with 723 additions and 966 deletions

View File

@ -127,17 +127,17 @@ class StaffForm(forms.ModelForm):
queryset=Service.objects.all(),
required=False,
)
phone_number = SaudiPhoneNumberField(
required=False,
widget=forms.TextInput(
attrs={
"class": "form-control",
"placeholder": _("Phone Number"),
"id": "phone",
}
),
label=_("Phone Number"),
)
# phone_number = SaudiPhoneNumberField(
# required=False,
# widget=forms.TextInput(
# attrs={
# "class": "form-control",
# "placeholder": _("Phone Number"),
# "id": "phone",
# }
# ),
# label=_("Phone Number"),
# )
group = forms.ModelMultipleChoiceField(
label=_("Group"),
widget=forms.CheckboxSelectMultiple(attrs={"class": "form-check-input"}),

View File

@ -1466,7 +1466,7 @@ class Staff(models.Model):
first_name = models.CharField(max_length=255, verbose_name=_("First Name"))
last_name = models.CharField(max_length=255, verbose_name=_("Last Name"))
arabic_name = models.CharField(max_length=255, verbose_name=_("Arabic Name"))
arabic_name = models.CharField(max_length=255, verbose_name=_("Arabic Name"),null=True,blank=True)
phone_number = models.CharField(
max_length=255,
verbose_name=_("Phone Number"),

View File

@ -135,7 +135,7 @@ urlpatterns = [
),
path(
"<slug:dealer_slug>/crm/leads/<slug:slug>/update/",
views.LeadUpdateView.as_view(),
views.lead_update,
name="lead_update",
),
path(

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

View File

@ -13,4 +13,4 @@
</div>
</div>
{% endif %}
{% endblock %}
{% endblock %}

View File

@ -26,7 +26,16 @@
<form class="needs-validation" method="post" novalidate>
{% csrf_token %}
{{ redirect_field }}
{{ form|crispy }}
{{ form.first_name|as_crispy_field }}
{{ form.last_name|as_crispy_field }}
{{ form.arabic_name|as_crispy_field }}
{{ form.email|as_crispy_field }}
{{ form.phone_number|as_crispy_field }}
{{ form.address|as_crispy_field }}
{{ form.logo|as_crispy_field }}
{{ form.group|as_crispy_field }}
{% if form.errors %}
<div class="alert alert-danger mt-4" role="alert">
<h4 class="alert-heading small">{% trans "Please correct the following errors:" %}</h4>