2025-05-22 15:48:58 +05:30
|
|
|
from django.template.loader import render_to_string
|
2025-05-09 11:14:51 +05:30
|
|
|
|
|
|
|
|
from base.forms import ModelForm
|
2025-05-22 15:48:58 +05:30
|
|
|
|
2025-05-09 11:14:51 +05:30
|
|
|
from .models import GeoFencing
|
2025-05-22 15:48:58 +05:30
|
|
|
|
2025-05-09 11:14:51 +05:30
|
|
|
|
|
|
|
|
class GeoFencingSetupForm(ModelForm):
|
|
|
|
|
verbose_name = "Geofence Configuration"
|
2025-05-22 15:48:58 +05:30
|
|
|
|
2025-05-09 11:14:51 +05:30
|
|
|
class Meta:
|
|
|
|
|
model = GeoFencing
|
|
|
|
|
exclude = ["company_id"]
|
|
|
|
|
|
|
|
|
|
def as_p(self):
|
|
|
|
|
"""
|
|
|
|
|
Render the form fields as HTML table rows with Bootstrap styling.
|
|
|
|
|
"""
|
|
|
|
|
context = {"form": self}
|
|
|
|
|
table_html = render_to_string("common_form.html", context)
|
|
|
|
|
return table_html
|