tum пре 11 месеци
родитељ
комит
203194ffe1
5 измењених фајлова са 48 додато и 4 уклоњено
  1. 9 1
      app/core/filters.py
  2. 3 0
      app/core/models.py
  3. 7 1
      app/legacy/urls.py
  4. 26 2
      app/legacy/views.py
  5. 3 0
      app/templates/base.html

+ 9 - 1
app/core/filters.py

1
 import django_filters
1
 import django_filters
2
-from .models import VMasterView, MgMasterView, BelMasterView, EMasterView
2
+from .models import VMasterView, MgMasterView, BelMasterView, EMasterView, AllProductDimensionForInsProcess
3
 
3
 
4
 class VMasterViewFilter(django_filters.FilterSet):
4
 class VMasterViewFilter(django_filters.FilterSet):
5
     """
5
     """
64
     class Meta:
64
     class Meta:
65
         model = EMasterView
65
         model = EMasterView
66
         fields = ['pro1', 'pro2']  # Add other fields to filter as needed
66
         fields = ['pro1', 'pro2']  # Add other fields to filter as needed
67
+
68
+
69
+class AllProductDimensionForInsProcessFilter(django_filters.FilterSet):
70
+    ProductCode = django_filters.CharFilter(field_name='ProductCode', lookup_expr='icontains')
71
+
72
+    class Meta:
73
+        model = AllProductDimensionForInsProcess
74
+        fields = ["ProductCode"]

+ 3 - 0
app/core/models.py

393
 
393
 
394
     class Meta:
394
     class Meta:
395
         managed = False  # This model corresponds to a database view
395
         managed = False  # This model corresponds to a database view
396
+        app_label = "legacy"
396
         db_table = 'AllProduct_Average_OB_MIN_MAX_view'  # Name of the database view
397
         db_table = 'AllProduct_Average_OB_MIN_MAX_view'  # Name of the database view
397
 
398
 
398
 class AllProductDimensionForInsProcess(models.Model):
399
 class AllProductDimensionForInsProcess(models.Model):
406
 
407
 
407
     class Meta:
408
     class Meta:
408
         managed = False  # This model corresponds to a database view
409
         managed = False  # This model corresponds to a database view
410
+        app_label = "legacy"
409
         db_table = 'AllProduct_Dimension_ForInsProcess'  # Name of the database view
411
         db_table = 'AllProduct_Dimension_ForInsProcess'  # Name of the database view
410
 
412
 
411
 class AllProductPressPositionPressWeight(models.Model):
413
 class AllProductPressPositionPressWeight(models.Model):
437
 
439
 
438
     class Meta:
440
     class Meta:
439
         managed = False  # This model corresponds to a database view
441
         managed = False  # This model corresponds to a database view
442
+        app_label = "legacy"
440
         db_table = 'AllProduct_PressPosition_PressWeight'  # Name of the database view
443
         db_table = 'AllProduct_PressPosition_PressWeight'  # Name of the database view

+ 7 - 1
app/legacy/urls.py

2
 from .views import DataListView, DataDetailView, DataCreateView, DataUpdateView, DataDeleteView,\
2
 from .views import DataListView, DataDetailView, DataCreateView, DataUpdateView, DataDeleteView,\
3
 DataMsCRUDView, TbFgPressInfoLotListCRUDView, LotSummaryCRUDView, VMasterViewCRUDView, MgMasterViewCRUDView,\
3
 DataMsCRUDView, TbFgPressInfoLotListCRUDView, LotSummaryCRUDView, VMasterViewCRUDView, MgMasterViewCRUDView,\
4
 BelMasterViewCRUDView, EMasterViewCRUDView, DataRLCRUDView, DataWbCRUDView, LotSummaryRlCRUDView, \
4
 BelMasterViewCRUDView, EMasterViewCRUDView, DataRLCRUDView, DataWbCRUDView, LotSummaryRlCRUDView, \
5
-LotSummaryWbCRUDView, RotateDataCRUDView, ManualsizeCRUDView
5
+LotSummaryWbCRUDView, RotateDataCRUDView, ManualsizeCRUDView, AllProductDimensionForInsProcessCRUDView
6
 
6
 
7
 app_name = 'legacy'  # Namespace for this app
7
 app_name = 'legacy'  # Namespace for this app
8
 
8
 
19
 lswb_crud = LotSummaryWbCRUDView()
19
 lswb_crud = LotSummaryWbCRUDView()
20
 rotate_crud = RotateDataCRUDView()
20
 rotate_crud = RotateDataCRUDView()
21
 manualsize_crud = ManualsizeCRUDView()
21
 manualsize_crud = ManualsizeCRUDView()
22
+allproductdimension_crud = AllProductDimensionForInsProcessCRUDView()
22
 
23
 
23
 urlpatterns = [
24
 urlpatterns = [
24
     path('data/', DataListView.as_view(), name='data-list'),            # data/
25
     path('data/', DataListView.as_view(), name='data-list'),            # data/
92
     path('manualsize/create/', manualsize_crud.get_create_view().as_view(), name='manualsize-create'),
93
     path('manualsize/create/', manualsize_crud.get_create_view().as_view(), name='manualsize-create'),
93
     path('manualsize/<str:pk>/update/', manualsize_crud.get_update_view().as_view(), name='manualsize-update'),
94
     path('manualsize/<str:pk>/update/', manualsize_crud.get_update_view().as_view(), name='manualsize-update'),
94
     path('manualsize/<str:pk>/delete/', manualsize_crud.get_delete_view().as_view(), name='manualsize-delete'),
95
     path('manualsize/<str:pk>/delete/', manualsize_crud.get_delete_view().as_view(), name='manualsize-delete'),
96
+    
97
+    path('allproductdimension/', allproductdimension_crud.get_list_view().as_view(), name='allproductdimension-list'),
98
+    path('allproductdimension/create/', allproductdimension_crud.get_create_view().as_view(), name='allproductdimension-create'),
99
+    path('allproductdimension/<str:pk>/update/', allproductdimension_crud.get_update_view().as_view(), name='allproductdimension-update'),
100
+    path('allproductdimension/<str:pk>/delete/', allproductdimension_crud.get_delete_view().as_view(), name='allproductdimension-delete'),
95
 ]
101
 ]

+ 26 - 2
app/legacy/views.py

18
 from django.urls import reverse
18
 from django.urls import reverse
19
 from django.contrib import messages
19
 from django.contrib import messages
20
 from pprint import pprint
20
 from pprint import pprint
21
-from core.models import VMasterView, MgMasterView, BelMasterView, EMasterView
22
-from core.filters import VMasterViewFilter, MgMasterViewFilter, BelMasterViewFilter, EMasterViewFilter
21
+from core.models import VMasterView, MgMasterView, BelMasterView, EMasterView, \
22
+        AllProductDimensionForInsProcess
23
+from core.filters import VMasterViewFilter, MgMasterViewFilter, BelMasterViewFilter, EMasterViewFilter,\
24
+        AllProductDimensionForInsProcessFilter
23
 
25
 
24
 from core.utils import ConfigurableCRUDView
26
 from core.utils import ConfigurableCRUDView
25
 
27
 
417
     # Define the order of fields to be displayed
419
     # Define the order of fields to be displayed
418
     config_field_orders = ["lotno", "size_name", "std", "tolun", "tolup", "created_at", "productcode"]
420
     config_field_orders = ["lotno", "size_name", "std", "tolun", "tolup", "created_at", "productcode"]
419
 
421
 
422
+class AllProductDimensionForInsProcessCRUDView(ConfigurableCRUDView):
423
+    model = AllProductDimensionForInsProcess
424
+    list_template_name = 'legacy/datacrud_list.html'
425
+    detail_template_name = 'legacy/datacrud_detail.html'
426
+    form_template_name = 'legacy/datacrud_form.html'
427
+    confirm_delete_template_name = 'legacy/datacrud_confirm_delete.html'
428
+
429
+    filterset_class = AllProductDimensionForInsProcessFilter  # If a filter is needed
430
+
431
+    page_title = "All Product Dimension for Inspection Process"
432
+
433
+    # URL name mappings
434
+    list_url_name = 'legacy:allproductdimension-list'
435
+    create_url_name = 'legacy:allproductdimension-create'
436
+    update_url_name = 'legacy:allproductdimension-update'
437
+    delete_url_name = 'legacy:allproductdimension-delete'
438
+
439
+    # Define the order of fields to be displayed
440
+    config_field_orders = ["ProdType", "ProductCode", "Size_Id", "Size_Name", "Std", "TolUn", "TolUp"]
441
+
442
+    # Exclude fields if necessary
443
+

+ 3 - 0
app/templates/base.html

123
                           <li>
123
                           <li>
124
                             <a href="{% url "legacy:manualsize-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Manual Size</a>
124
                             <a href="{% url "legacy:manualsize-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Manual Size</a>
125
                           </li>
125
                           </li>
126
+                          <li>
127
+                            <a href="{% url "legacy:allproductdimension-list" %}" class="flex items-center w-full p-2 text-gray-900 transition duration-75 rounded-lg pl-11 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700">Product Dimension</a>
128
+                          </li>
126
                     </ul>
129
                     </ul>
127
                  </li>
130
                  </li>
128
                  <li>
131
                  <li>