[RMV] commented lines
This commit is contained in:
@@ -44,54 +44,4 @@ class HorillaMultiSelectWidget(forms.Widget):
|
|||||||
context["filter_route_name"] = self.filter_route_name
|
context["filter_route_name"] = self.filter_route_name
|
||||||
self.attrs["id"] = ("id_" + name ) if self.attrs.get('id') is None else self.attrs.get("id")
|
self.attrs["id"] = ("id_" + name ) if self.attrs.get('id') is None else self.attrs.get("id")
|
||||||
context[self.filter_instance_contex_name] = self.filter_class
|
context[self.filter_instance_contex_name] = self.filter_class
|
||||||
if self.instance is not None:
|
|
||||||
data = getattr(self.instance,field)
|
|
||||||
print(data)
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
def value_from_datadict(self, data, files, name):
|
|
||||||
print(data)
|
|
||||||
print('---------------------')
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
Attendance form field updations
|
|
||||||
"""
|
|
||||||
|
|
||||||
# def clean(self) -> Dict[str, Any]:
|
|
||||||
# self.instance.employee_id = Employee.objects.filter(
|
|
||||||
# id=self.data.get("employee_id")
|
|
||||||
# ).first()
|
|
||||||
|
|
||||||
# self.errors.pop("employee_id", None)
|
|
||||||
# if self.instance.employee_id is None:
|
|
||||||
# raise ValidationError({"employee_id": "This field is required"})
|
|
||||||
# super().clean()
|
|
||||||
# employee_ids = self.data.getlist("employee_id")
|
|
||||||
# existing_attendance = Attendance.objects.filter(
|
|
||||||
# attendance_date=self.data["attendance_date"]
|
|
||||||
# ).filter(employee_id__id__in=employee_ids)
|
|
||||||
# if existing_attendance.exists():
|
|
||||||
# raise ValidationError(
|
|
||||||
# {
|
|
||||||
# "employee_id": f"""Already attendance exists for {list(existing_attendance.values_list("employee_id__employee_first_name",flat=True))} employees"""
|
|
||||||
# }
|
|
||||||
# )
|
|
||||||
|
|
||||||
|
|
||||||
# class AttendanceForm(ModelForm):
|
|
||||||
# """
|
|
||||||
# Model form for Attendance model
|
|
||||||
# """
|
|
||||||
|
|
||||||
# employee_id = HorillaMultiSelectField(
|
|
||||||
# queryset=Employee.objects.filter(employee_work_info__isnull=False),
|
|
||||||
# widget=HorillaMultiSelectWidget(
|
|
||||||
# filter_route_name="employee-widget-filter",
|
|
||||||
# filter_class=EmployeeFilter,
|
|
||||||
# filter_instance_contex_name="f",
|
|
||||||
# filter_template_path="employee_filters.html",
|
|
||||||
# ),
|
|
||||||
# label=_("Employees"),
|
|
||||||
# )
|
|
||||||
Reference in New Issue
Block a user