Przeglądaj źródła

delete last updates

kateshev14 5 miesięcy temu
rodzic
commit
3e1a8d52ae
4 zmienionych plików z 0 dodań i 67 usunięć
  1. 0 5
      tables.py
  2. 0 14
      templates/webservice_running/order_reg_delete.html
  3. 0 2
      urls.py
  4. 0 46
      views.py

+ 0 - 5
tables.py

@@ -8,11 +8,6 @@ class OrderList(tables.Table):
     
     name_order = tables.Column(verbose_name=('Экскурсия'))
     price = tables.Column(verbose_name=('Цена'))
-    edit = tables.LinkColumn('order_reg/edit/', verbose_name='', orderable=False, text = "E",
-        args=[tables.A('pk')], attrs={'th':{'scope':'col'}, "td":{"class":"edit_col"}})
-    delete = tables.LinkColumn('order_reg/delete/', verbose_name='', orderable=False, text = "D",
-        args=[tables.A('pk')], attrs={'th':{'scope':'col'}, "td":{"class":"delete_col"}})
-
 
     class Meta:
         model = OrdersLocal

+ 0 - 14
templates/webservice_running/order_reg_delete.html

@@ -1,14 +0,0 @@
-{% extends 'SharixAdmin/index.html' %}
-{% load i18n %}
-
-{% block contenthome %}
-<form method="post">
-    {% csrf_token %}
-    <div class="container m-2">
-        <p>{% blocktrans %}Are you sure you want to delete \"%(object.caption)s\"?{% endblocktrans %}</p>
-    </div>
-    <div class="text-center mt-2 mb-5">
-        <input class="btn btn-primary center" type="submit" name="apply" value="{% trans 'Delete' %}"/>
-    </div>
-</form>
-{% endblock %}

+ 0 - 2
urls.py

@@ -11,8 +11,6 @@ router = routers.DefaultRouter()
 router.register(r'webservice', OrdersLocalMVS)
 
 urlpatterns = [
-    path('order_reg/edit/<int:pk>', login_required(OrderRegUpdateView.as_view()), name='order_reg/edit/'),
-    path('order_reg/delete/<int:pk>', login_required(OrderRegDelete.as_view()), name='order_reg/delete/'),
     path('order_list/', login_required(OrdersListView.as_view()), name="order_list"),
     path('order_reg/', login_required(OrderReg.as_view()), name="order_reg"),
     path('', views.registration, name="registration"),

+ 0 - 46
views.py

@@ -41,52 +41,6 @@ class OrderReg(CreateView):
             return True
         return False
 
-class OrderRegUpdateView(UserPassesTestMixin, UpdateView):
-    model = OrdersLocal
-    form_class = OrderRegForm
-    template_name = "SharixAdmin/order_reg.html"
-
-    def get_context_data(self, **kwargs):
-        context = super().get_context_data(**kwargs)
-        context.update({
-            'title': _('Заявка на экскурсию'),
-            'object': self.object,
-            "current_page": "order_reg"
-        })
-        return context
-    
-    
-    def test_func(self) -> bool or None:
-        group_names = ('METASERVICE-ADMIN')
-        if bool(self.request.user.groups.filter(name=group_names)) or self.request.user:
-            return True
-        return False
-    
-    def get_success_url(self):
-        return reverse('order_reg')
-
-class OrderRegDelete(UserPassesTestMixin, DeleteView):
-    model = OrdersLocal
-    template_name = "SharixAdmin/order_reg_delete.html"
-
-    def get_context_data(self, **kwargs):
-        context = super().get_context_data(**kwargs)
-        context.update({
-            'title': 'Заявка на экскурсию',
-            'object': self.object,
-            "current_page": "order_reg"
-        })
-        return context
-    
-    def get_success_url(self):
-        return reverse('order_reg')
-    
-    def test_func(self) -> bool or None:
-        group_names = ('METASERVICE-ADMIN')
-        if bool(self.request.user.groups.filter(name=group_names)) or self.request.user.is_superuser:
-            return True
-        return False
-
 class OrdersListView(UserPassesTestMixin, SingleTableView):
     table_class = OrderList
     queryset = OrdersLocal.objects.all()