Exemplo n.º 1
0
 def test_view_with_model_no_filterset(self):
     factory = RequestFactory()
     request = factory.get(self.base_url)
     view = FilterView.as_view(model=Book)
     response = view(request)
     self.assertEqual(response.status_code, 200)
     for b in ['Ender's Game', 'Rainbow Six', 'Snowcrash']:
         self.assertContains(response, b)
Exemplo n.º 2
0
 def test_view_with_model_no_filterset(self):
     factory = RequestFactory()
     request = factory.get(self.base_url)
     view = FilterView.as_view(model=Book)
     response = view(request)
     self.assertEqual(response.status_code, 200)
     for b in ['Ender's Game', 'Rainbow Six', 'Snowcrash']:
         self.assertContains(response, b)
Exemplo n.º 3
0
    def test_view_with_bad_filterset(self):
        class MyFilterSet(FilterSet):
            pass

        factory = RequestFactory()
        request = factory.get(self.base_url)
        view = FilterView.as_view(filterset_class=MyFilterSet)
        with self.assertRaises(ImproperlyConfigured):
            view(request)
Exemplo n.º 4
0
    def test_view_with_bad_filterset(self):
        class MyFilterSet(FilterSet):
            pass

        factory = RequestFactory()
        request = factory.get(self.base_url)
        view = FilterView.as_view(filterset_class=MyFilterSet)
        with self.assertRaises(ImproperlyConfigured):
            view(request)
Exemplo n.º 5
0
    def test_view_with_non_strict_errors(self):
        factory = RequestFactory()
        request = factory.get(self.base_url + '?title=Snowcrash&price=four dollars')
        view = FilterView.as_view(model=Book, strict=False)
        response = view(request)
        titles = [o.title for o in response.context_data['object_list']]

        self.assertEqual(response.status_code, 200)
        self.assertEqual(titles, ['Snowcrash'],)
Exemplo n.º 6
0
    def test_view_with_strict_errors(self):
        factory = RequestFactory()
        request = factory.get(self.base_url +
                              '?title=Snowcrash&price=four dollars')
        view = FilterView.as_view(model=Book)
        response = view(request)
        titles = [o.title for o in response.context_data['object_list']]

        self.assertEqual(response.status_code, 200)
        self.assertEqual(titles, [])
Exemplo n.º 7
0
    def test_view_with_unbound_filter_form_returns_initial_queryset(self):
        factory = RequestFactory()
        request = factory.get(self.base_url)

        queryset = Book.objects.filter(title='Snowcrash')
        view = FilterView.as_view(model=Book, queryset=queryset)

        response = view(request)
        titles = [o.title for o in response.context_data['object_list']]

        self.assertEqual(response.status_code, 200)
        self.assertEqual(titles, ['Snowcrash'])
Exemplo n.º 8
0
    def test_view_with_unbound_filter_form_returns_initial_queryset(self):
        factory = RequestFactory()
        request = factory.get(self.base_url)

        queryset = Book.objects.filter(title='Snowcrash')
        view = FilterView.as_view(model=Book, queryset=queryset)

        response = view(request)
        titles = [o.title for o in response.context_data['object_list']]

        self.assertEqual(response.status_code, 200)
        self.assertEqual(titles, ['Snowcrash'])
Exemplo n.º 9
0
    def test_view_with_model_and_fields_no_filterset(self):
        factory = RequestFactory()
        request = factory.get(self.base_url + '?price=1.0')
        view = FilterView.as_view(model=Book, filterset_fields=['price'])

        # filtering only by price
        response = view(request)
        self.assertEqual(response.status_code, 200)
        for b in ['Ender's Game', 'Rainbow Six', 'Snowcrash']:
            self.assertContains(response, b)

        # not filtering by title
        request = factory.get(self.base_url + '?title=Snowcrash')
        response = view(request)
        self.assertEqual(response.status_code, 200)
        for b in ['Ender's Game', 'Rainbow Six', 'Snowcrash']:
            self.assertContains(response, b)
Exemplo n.º 10
0
    def test_view_with_model_and_fields_no_filterset(self):
        factory = RequestFactory()
        request = factory.get(self.base_url + '?price=1.0')
        view = FilterView.as_view(model=Book, filterset_fields=['price'])

        # filtering only by price
        response = view(request)
        self.assertEqual(response.status_code, 200)
        for b in ['Ender's Game', 'Rainbow Six', 'Snowcrash']:
            self.assertContains(response, b)

        # not filtering by title
        request = factory.get(self.base_url + '?title=Snowcrash')
        response = view(request)
        self.assertEqual(response.status_code, 200)
        for b in ['Ender's Game', 'Rainbow Six', 'Snowcrash']:
            self.assertContains(response, b)
Exemplo n.º 11
0
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
from django_filters.views import FilterView
from inventory_tracker import views
from inventory_tracker.models import Property
from inventory_tracker.admin import admin_site

from django.contrib.admin.views.decorators import staff_member_required

urlpatterns = [
    # Examples:
    # url(r'^$', 'bep_bep.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^favicon\.ico$', RedirectView.as_view(url='/static/favicon.ico', permanent=True)),
    url(r'^admin/', include(admin_site.urls)),
    url(r'^$', staff_member_required(views.PropertyView.as_view()), name='fieldwork'),
    url(r'^filter/', FilterView.as_view(model=Property)),
    url(r'^search/', staff_member_required(views.property_filter), name='filter'),
]
Exemplo n.º 12
0
    path('pembekal/<int:pk>/stok/<int:stok_pk>/',
         views.inventoris,
         name='inventoris'),
    path('pembekal/<int:pk>/stok/<int:stok_pk>/new/',
         views.new_inventori,
         name='new_inventori'),
    path(
        'pembekal/<int:pk>/stok/<int:stok_pk>/inventori/<int:inventori_pk>/edit/',
        views.InventoriEditView.as_view(),
        name='edit_inventori'),
    path(
        'pembekal/<int:pk>/stok/<int:stok_pk>/inventori/<int:inventori_pk>/delete/',
        views.InventoriDeleteView.as_view(),
        name='delete_inventori'),
    path('search_user/',
         FilterView.as_view(filterset_class=UserFilter,
                            template_name='filter_user_list.html'),
         name='search_user'),
    path('search_inventori/',
         FilterView.as_view(filterset_class=InventoriFilter,
                            template_name='filter_inventori_list.html'),
         name='search_inventori'),
    path('upload_picture/<int:pk>/upload/',
         accounts_views.model_form_upload,
         name='upload_picture'),
    path('upload_picture/<int:pk>/pictures/',
         accounts_views.filter_pictures,
         name='uploaded_pictures'),
    path('admin/', admin.site.urls),
]

if settings.DEBUG:
Exemplo n.º 13
0
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views import defaults as default_views
from django.views.generic import TemplateView
from mysuper.users import views
from mysuper.users.models import Department
from django_filters.views import FilterView

urlpatterns = [
    url(r'^$', TemplateView.as_view(template_name='pages/home.html'), name="home"),
    url(r'^about/$', TemplateView.as_view(template_name='pages/about.html'), name="about"),
    
    url(r'^listDeps/$', FilterView.as_view(model=Department)),
    
     url(
        regex=r'^department$',
        view=views.DepartmentListView.as_view(),
        name='listdep'
    ),

    # URL pattern for the DepartmentRedirectView
 
    # URL pattern for the DepartmentDetailView
    url(
        regex=r'department(?P<name>[\w.@+-]+)/$',
        view=views.DepartmentDetailView.as_view(),
        name='department-detail'
    ),
Exemplo n.º 14
0
    path('', views.Index.as_view(), name='index'),

    # aluno
    path('aluno/', views.AlunoList.as_view(), name='aluno_lista'),
    path('aluno/novo', views.AlunoCreate.as_view(), name='aluno_novo'),
    path('aluno/<int:pk>/', views.AlunoDetail.as_view(), name='aluno_info'),

    # requerimento genérico
    path('requerimento/<int:pk>/',
         views.requerimento_info,
         name='requerimento_info'),
    path('requerimento/',
         views.RequerimentoList.as_view(),
         name='requerimento_lista'),
    path('requerimento/busca/',
         FilterView.as_view(filterset_class=RequerimentoFilter),
         name='requerimento_busca'),
    path('requerimento/<int:pk>/parecer/',
         views.requerimento_parecer,
         name='requerimento_parecer'),

    # requerimento matrícula
    path('requerimento/matricula/novo/',
         views.requerimentomatricula_novo,
         name='requerimento_matricula_novo'),

    # protocolo avulso
    path('protav/novo/',
         views.protocoloavulso_novo,
         name='protocolo_avulso_novo'),
    path('protav/<int:pk>/',
Exemplo n.º 15
0
from django.conf.urls import url
from django.urls import path
from django_filters.views import FilterView

from . import views
from .filters import MovieFilter

app_name = 'imdb'
urlpatterns = [
    url('', FilterView.as_view(filterset_class=MovieFilter,
                                         template_name='imdb/movie_list.html'))
]
Exemplo n.º 16
0
    # media files
    path('StaticMediaRead/', CarsModelFormDisplay_view,
         name='StaticMediaRead'),
    # form widgets & form validations
    path('ChoiceField/', ChoiceForm_view, name='ChoiceField'),
    path('FormValidate/', ProductFormValidate_view, name='FormValidate'),
    path('FormValidate2/', FormValidateTest_view, name='FormValidate2'),
    # class Based View
    path('CBVExamples/', include('CBVExamples.urls')),
    #Tabular Form and Child Master forms
    path('MarksTab/', modelformsetFactory, name='MarksTab'),  #tabular form
    path('childMasterCreate/', create,
         name='childMasterCreate'),  #master master relationship form
    path('Slist/', list, name='slist'),
    # Rest API examples
    path("CryptoHome/", CryptoHome, name="CryptoHome"),
    path("Cryptoprice/", price, name="Cryptoprice"),
    #filter forms
    path('snippetList/', snippetListView.as_view(), name="snippetList"),
    path('search/', search, name='search'),
    path('searchC/',
         FilterView.as_view(filterset_class=UserFilter,
                            template_name='myapp/user_list.html'),
         name='searchC'),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Exemplo n.º 17
0
Arquivo: urls.py Projeto: EOP-OMB/opal
app_name = 'ssp'
urlpatterns = [
    path('nist/',
         nist_control_list_view.as_view(),
         name='nist_control_list_view'),
    path('nist/<int:pk>',
         nist_control_detail_view.as_view(),
         name='nist_control_detail_view'),
    # path('control/', system_control_list_view.as_view(), name='system_control_list_view'),
    path('evidence/', evidence_list_view.as_view(), name='evidence_list_view'),
    path('evidence/<int:pk>',
         evidence_detail_view.as_view(),
         name='evidence_detail_view'),
    path('control/',
         FilterView.as_view(filterset_class=system_control_list_view_filter,
                            template_name='ssp/system_control_list.html'),
         name='system_control_list_view'),
    path('control/<int:pk>',
         system_control_detail_view.as_view(),
         name='system_control_detail_view'),
    path('attachments',
         attachment_list_view.as_view(),
         name='attachment_list_view'),
    path('links', link_list_view.as_view(), name='link_list_view'),
    path('',
         system_security_plan_list_view.as_view(),
         name='list_system_security_planView'),
    path('<int:pk>',
         system_security_plan_detail_view.as_view(),
         name='system_security_plan_detail_view'),
    path('new/', ssp_new, name='ssp_new'),
Exemplo n.º 18
0
from django.conf.urls import url
from django.urls import path
from . import views
from . import filters
from django_filters.views import FilterView
urlpatterns = [
    path('', views.IndexView.as_view(), name='store'),
    path('search/', FilterView.as_view(filterset_class= filters.ProductFilter ,template_name = 'store/filterList.html'), name='search'),
    path('<int:pk>/',views.ProductsDetailView.as_view(),name='StoreDetails'),
]
Exemplo n.º 19
0
 url(r'^password-change/$',
     auth_views.PasswordChangeView.as_view(template_name='registration/password_change.html'),
     name='password_change'
 ),
 path('si/<int:id_sequence>/<int:id_ressource>/fiche_ressource/edit', fiche_ressource_edit),
 path('si/<int:id_sequence>/<int:id_ressource>/fiche_ressource/pdf', generer_fiche_synthese_PDF),
 path('si/<int:id_sequence>/<int:id_ressource>/fiche_ressource/', fiche_ressource_display),
 path('si/<int:id_etudiant>/<int:id_sequence>/<int:id_ressource>/fiche_ressource/edit', fiche_ressource_edit),
 path('si/<int:id_etudiant>/<int:id_sequence>/<int:id_ressource>/fiche_ressource/pdf', generer_fiche_synthese_PDF, name='totot'),
 path('si/<int:id_etudiant>/<int:id_sequence>/<int:id_ressource>/fiche_ressource/', fiche_ressource_display),
 path('mes_fiches_ressource/', liste_fiches_ressource),
 path('si/<int:id_sequence>/videos/', afficher_sequence_videos),
 path('si/<int:id_sequence>/r<int:id_ressource>/videos/', afficher_ressource_videos),
 path('<str:matiere>/ds/', lister_ds, name='django_education-lister_ds'),
 path('<str:matiere>/competences', lister_competences, name='django_education-lister_competences'),
 path('<str:matiere>/systemes/', FilterView.as_view(filterset_class=SystemeFiltre,
         template_name='systemes.html'), name='lister_systemes'),
 path('systemes/', FilterView.as_view(filterset_class=SystemeFiltre,
         template_name='systemes.html'), name='lister_systemes'),
 path('<str:matiere>/systeme/<int:id_systeme>/', afficher_systeme),
 path('systeme/<int:id_systeme>/', afficher_systeme),
 path('systeme/<int:id_systeme>/sysml', afficher_sysml),
 path('systeme/<int:id_systeme>/images/<str:data>', relative_url_image_sysml),
 path('systeme/<int:id_systeme>/<str:dossier>/<str:data>', relative_url_sysml),
 path('competence/<int:id_famille>/', afficher_famille_competence),
 path('competence/<int:id_famille>/<int:id_competence>/', afficher_competence),
 path('<str:matiere>/competence/<int:id_famille>/', afficher_famille_competence),
 path('<str:matiere>/competence/<int:id_famille>/<int:id_competence>/', afficher_competence),
 path('q/<str:nomquiz>/<str:action>/uploads/<str:year>/<str:month>/<str:day>/<str:nom>.<str:ext>', relative_url_view),
 path('admin/django_education/systeme/<str:id_systeme>/<str:action>/systemes/<str:nom>.<str:ext>', relative_url_view_systeme),
 path('admin/multichoice/mcquestion/<str:nomquiz>/<str:action>/uploads/<str:year>/<str:month>/<str:day>/<str:nom>.<str:ext>', relative_url_view),
 path('resultats/<int:id_etudiant>/ds/', ds_eleve),
Exemplo n.º 20
0
Arquivo: urls.py Projeto: olcf/harmony
from django.urls import path, re_path
from rgt import views
from django_filters.views import FilterView
from rgt import filters

urlpatterns = [
    path('', views.index, name='index'),
    # path('tests/', views.TestListView.as_view(), name='test-list'),
    path('tests/',
         FilterView.as_view(filterset_class=filters.TestFilter,
                            template_name='rgt/test_list.html'),
         name='test-list'),
    # Only match harness uids that consist of numbers
    # TODO: Think about changing this from harness uid to application/testname/testinstance.
    # TODO: Not sure if necessary though.
    re_path(r'^tests/(?P<app>[-.\w]+)$',
            views.AppTestListView.as_view(),
            name='app-test-list'),
    re_path(r'^tests/(?P<app>[-.\w]+)/(?P<testname>[-.\w]+)/$',
            views.TestnameTestListView.as_view(),
            name='testname-test-list'),
    re_path(r'^tests/(?P<app>[-.\w]+)/(?P<testname>[-.\w]+)/(?P<hid>[.\d]+)/$',
            views.TestDetailView.as_view(),
            name='test-detail'),
    # Allow any characters at the end because we need to pass what the next url is after each form is submitted.
    re_path(
        r'^tests/(?P<app>[-.\w]+)/(?P<testname>[-.\w]+)/(?P<hid>[.\d]+)/create/*$',
        views.FailureCreateView.as_view(),
        name='failure-create'),
    re_path(
        r'^tests/(?P<app>[-.\w]+)/(?P<testname>[-.\w]+)/(?P<hid>[.\d]+)/delete/*$',
Exemplo n.º 21
0
from django.urls import path
from . import views

from django_filters.views import FilterView
from .models import Item

app_name = 'core'
urlpatterns = [
    path('', views.HomeView.as_view(), name='index'),
    path('product/<str:pk>/', views.product, name='product'),
    path('checkout/', views.CheckoutView.as_view(), name='checkout'),
    path('add-to-cart/<str:pk>/', views.add_to_cart, name='add-to-cart'),
    path('add-coupon/', views.AddCoupon.as_view(), name='add-coupon'),
    path('order-summary/', views.OrderSummaryView.as_view(), name='order-summary'),
    path('remove-from-cart/<str:pk>/',
         views.remove_from_cart, name='remove-from-cart'),
    path('remove-single-item-from-cart/<str:pk>/',
         views.remove_single_item_from_cart, name='remove-single-item-from-cart'),
    path('payment/<str:payment_option>/',
         views.PaymentView.as_view(), name='payment'),
    path('request-refund/', views.RequestFundView.as_view(), name='request-refund'),
    path('register/', views.RegisterView.as_view(), name='register'),
    #     path('acc/login/', views.LoginView.as_view(), name='login'),
    path('logout/', views.logout_view, name='logout'),
    path('product/',
         FilterView.as_view(model=Item,                                               filterset_fields=['name', 'category']), name='product-filter'),
]
Exemplo n.º 22
0
from django.urls import path
from . import views
from django.contrib.auth import views as auth_views
from django.conf.urls import url
from django_filters.views import FilterView
from apps.management.filters import StudentFilter

urlpatterns = [

  path('singup/',views.SingUp,name='singup'),
  path('signup/student/', views.StudentSignUpView.as_view(), name='student_signup'),
  path('signup/libman/', views.LibmanSignUpView.as_view(), name='libman_signup'),
  path('profile/',views.profile, name='profile'),

  path('login/',views.LoginView.as_view(),name='login'),
  path('logout/',auth_views.LogoutView.as_view(template_name='users/auth/logout.html'),name='logout'),

   path('forgot_password/', views.ForgotPasswordView.as_view(), name='accounts_forgot_password'),
   path('change_password/', views.ChangePasswordView.as_view(), name='accounts_change_password'),
   path('password_reset/<int:id>/-<reset_code>/',views.PasswordResetView.as_view(), name='accounts_password_reset'),


    url(r'^search_student/$', FilterView.as_view(filterset_class=StudentFilter,
    template_name='management/search_student_list.html'), name='search_student'),

]

Exemplo n.º 23
0
from django.urls import path
from .views import *
from django_filters.views import FilterView

app_name = 'jobs'

urlpatterns = [
    path('',
         FilterView.as_view(filterset_class=JobFilter,
                            template_name='jobs/job_list.html'),
         name='index'),
    path('companies/', CompanyListView.as_view(), name='companies'),
]
Exemplo n.º 24
0
urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'meddle.views.home', name='home'),
    # url(r'^meddle/', include('meddle.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

   url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {
           'document_root': settings.MEDIA_ROOT,
       }),
   url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {
           'document_root': settings.STATIC_ROOT,
       }),                       

    # Uncomment the next line to enable the admin: 
    url(r'^admin/', include(admin.site.urls)),
    url(r'^htsql/', include('htsql_django.urls')),

    url(r'^citedin_trends/(?P<year>\d+)/$', views.cited_in_trends ),
    url(r'^citedin/(?P<year>\d+)/$', views.cited_in ),
    url(r'^mesh/(?P<year_start>\d+)/(?P<year_end>\d+)$', views.mesh_network ),
    url(r'^branches/(?P<year>\d+)/$', views.branch_network ),
    url(r'^jurisprudence/$', views.jurisprudence_network ),
    url(r'^breast_cancer/$', views.breast_cancer_network ),
    url(r'^clinical/$', views.clinical_network )                 
    url(r'^lista/', FilterView.as_view(model=Citation)),
    url(r'^list/', views.citation_list),
)
Exemplo n.º 25
0
from . import views
from django_filters.views import FilterView
from django_filters.views import object_filter
from .models import Backlinks
from django.contrib.auth.views import login, logout

urlpatterns = [
    path('', views.pre_index, name='pre_index'),
    path('index', views.index, name='index'),
    path('backlinks/', views.backlinks, name='backlinks'),
    path('backlinks-scrapper/',
         views.backlinks_scrapper,
         name='backlinks_scrapper'),
    path('results/', views.bk_results, name='results'),
    path('search-bk/', views.search_bk, name='search_bk'),
    path('list-result/', FilterView.as_view(model=Backlinks)),
    path('foro/', views.search_foro, name='foro'),
    path('excel/', views.export_excel, name='excel'),

    # Single Ahrefs
    path('single-ahrefs/', views.single_ahrefs, name='single_ahrefs'),

    # Search to Google
    path('google/', views.google, name='google'),
    path('google-search/', views.google_search, name='google_search'),
    path('google-results/', views.google_results, name='google_results'),
    path('backlinks-google', views.bk_google_all, name='bk_google_all'),
    path('single-bk-google/<pk>', views.g_single, name='g_single'),
    path('delete-google/', views.delete_google, name='delete_google'),

    # CSV
Exemplo n.º 26
0
from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic import TemplateView

from django_filters.views import FilterView

from mysite.search.filters import ZipCodeFilter

urlpatterns = [
    url(r'^$', TemplateView.as_view(template_name='home.html'), name='home'),
    url(r'^search/$',
        FilterView.as_view(filterset_class=ZipCodeFilter,
                           template_name='search/user_list.html'),
        name='search'),
    url(r'^admin/', include(admin.site.urls)),
]
Exemplo n.º 27
0
        views.IngredientListAllView.as_view(),
        name='ingredient-list-all',
    ),

    # /ingredients/csvexport/
    url(
        r'^csvexport/$',
        views.IngredientCSVExportView,
        name='ingredient-csv-export',
    ),

    # Django-filter list
    # /ingredients/filter/<args>/
    url(
        r'^filter/$',
        FilterView.as_view(filterset_class=IngredientFilter),
        name='ingredient-filter',
    ),
    url(
        r'^tag/([0-9A-Za-z_-]+)/$',
        views.IngredientListByTagView.as_view(),
        name='ingredient-list-by-tag',
    ),

    # /ingredients/detail/<slug>/
    url(
        r'^detail/(?P<slug>[0-9A-Za-z_-]+)/$',
        views.IngredientDetailView.as_view(),
        name='ingredient-detail',
    ),
]
Exemplo n.º 28
0
urlpatterns = patterns('',
     #displays splash with login or redirects to /username
    url(r'^$', views.index, name='index'),

    #form to create new object
    url(r'^new/(?P<url_object>goat|herd|alert)/$', views.new, name='new'),

    #stat page and history for goats, with editable fields
    #this needs a detail view with a post and a get.
    #might want to reference by an ID number rather than name/
    url(r'^goat/(?P<name>\w+)/$', views.detail, name='detail'),

    #lists all objects, or objects that match optional search
    #optional search is not functional right now
    #can I make the name include the object?
    url(r'^herd/$', FilterView.as_view(model = Herd), name='herdlist'),

    url(r'^goat/$', views.goatlist, name='goatlist'),

    #shows upcoming events
    url(r'^(?P<username>\w+)/$', views.feed, name='feed'),

    #list of goats in herd
    #this is the above but search herd=herdname?
    #url(r'^/herd/(?P<name>\w+)/$', views.object_list, name='object_list'),

    #/data/new/<parameters> : (??) a form to upload data for multiple goats
    #/data/view : (???) analytics
)
Exemplo n.º 29
0
# The patterns method moved in Django 1.4.
try:
    from django.conf.urls import patterns
except ImportError:
    from django.conf.urls.defaults import patterns

from django_filters.tests.models import Book
from django_filters.views import FilterView

urlpatterns = patterns('',
    (r'^books-legacy/$', 'django_filters.views.object_filter', {'model': Book}),
    (r'^books/$', FilterView.as_view(model=Book)),
)
Exemplo n.º 30
0
from django.conf.urls import patterns, url
from homebrew.views import *
from homebrew.models import *
from django_filters.views import FilterView

urlpatterns = patterns('',
    url(r'^$', index, name='homebrew_index'),
    url(r'^recipes/$', FilterView.as_view(filterset_class=BeerRecipeFilter), name='recipe_home'),
    url(r'^recipes/(?P<homebrew_id>\d+)/$', recipedetails, name='homebrew_details'),
    url(r'^recipes/(?P<pk>\d+)/update/$', BeerRecipeUpdate.as_view(), name='recipe_update'),
    url(r'^recipes/(?P<homebrew_id>\d+)/fermentables/create/$', FermentableScheduleCreate.as_view(), name='recipe_fermentables_create'),
    url(r'^recipes/(?P<homebrew_id>\d+)/hops/create/$', HopScheduleCreate.as_view(), name='recipe_hops_create'),
    url(r'^recipes/(?P<homebrew_id>\d+)/yeastvariant/create/$', YeastVariantCreate.as_view(), name='recipe_yeast_create'),
    url(r'^recipes/(?P<homebrew_id>\d+)/notes/create/$', RecipeNotesCreate.as_view(), name='recipe_notes_create'),
    url(r'^recipes/create/$', BeerRecipeCreate.as_view(), name='recipe_create'),
    url(r'^yeast/$', FilterView.as_view(filterset_class=YeastTypeFilter), name='yeast_home'),
    url(r'^yeast/create/$', YeastTypeCreate.as_view(), name='yeast_create'),
    url(r'^yeast/(?P<pk>\d+)/$', YeastTypeDetail.as_view(), name='yeast_details'),
    url(r'^yeast/(?P<pk>\d+)/update/$', YeastTypeUpdate.as_view(), name='yeast_update'),
    url(r'^hops/$', FilterView.as_view(filterset_class=HopTypeFilter), name='hops_home'),
    url(r'^hops/(?P<pk>\d+)/$', HopTypeDetail.as_view(), name='hops_details'),
    url(r'^hops/(?P<pk>\d+)/update/$', HopTypeUpdate.as_view(), name='hops_update'),
    url(r'^hops/create/$', HopTypeCreate.as_view(), name='hops_create'),
    url(r'^beers/(?P<beer_id>\d+)/$', beerdetails, name='beer_details'),
    url(r'^beers/(?P<beer_id>\d+)/comment/create/$', beercomment, name='beer_comment'),
    
)
Exemplo n.º 31
0
from django.urls import path
from django_filters.views import FilterView
from django.contrib.auth import views as auth_views
from .views import BancoView, BancoNew, BancoEdit,CuentaView, CuentaNew, CuentaEdit, \
    cuenta_inactivar, banco_inactivar, ProveedorView, ProveedorNew, ProveedorEdit, proveedor_inactivar
from .models import Cuenta

urlpatterns = [
    path('bancos/', BancoView.as_view(), name='banco_list'),
    path('bancos/new', BancoNew.as_view(), name='banco_new'),
    path('bancos/edit/<int:pk>', BancoEdit.as_view(), name='banco_edit'),
    path('bancos/delete/<int:id>', banco_inactivar, name='banco_del'),
    path('cuenta/', CuentaView.as_view(), name='cuenta_list'),
    path('cuenta/new', CuentaNew.as_view(), name='cuenta_new'),
    path('cuenta/edit/<int:pk>', CuentaEdit.as_view(), name='cuenta_edit'),
    path('cuenta/delete/<int:id>', cuenta_inactivar, name='cuenta_del'),
    path('proveedor/', ProveedorView.as_view(), name='provedor_list'),
    path('proveedor/new', ProveedorNew.as_view(), name='provedor_new'),
    path('proveedor/edit/<int:pk>',
         ProveedorEdit.as_view(),
         name='provedor_edit'),
    path('proveedor/delete/<int:id>', proveedor_inactivar,
         name='provedor_del'),
    path('eje/', FilterView.as_view(model=Cuenta)),
]
Exemplo n.º 32
0
from django.conf.urls import patterns, url
from django_filters.views import FilterView

from .filters import ProductFilter

urlpatterns = patterns(
    '',
    (r'^list/$', FilterView.as_view(filterset_class=ProductFilter)),
)
Exemplo n.º 33
0
 url(r'^(?P<page>[0-9]+)/$', views.index, name="index"),
 url(r'^$', views.index_dim, name="sosatt"),
 url(r'^ask/$', views.AskView.as_view(), name="ask"),
 url(r'^topics/(?P<page>[0-9]+)/$', views.topics_view, name="topics"),
 url(r'^question/(?P<id>[0-9]+)/$', views.question_view, name="question"),
 url(r'^answer1/(?P<id>[0-9]+)/$', views.answer_view, name="answer1"),
 url(r'^answer2/(?P<id>[0-9]+)/$', views.answer2_view, name="answer2"),
 url(r'^answer/(?P<id>[0-9]+)/$', views.AnswerView.as_view(),
     name="answer"),
 url(r'^topic/(?P<id>[0-9]+)/$', views.topic_no_page, name="topic"),
 url(r'^topic/(?P<id>[0-9]+)/(?P<page>[0-9]+)/$',
     views.topic_view,
     name="topic"),
 url(r'^follow/$', views.follow_view, name="follow"),
 url(r'^search/$',
     FilterView.as_view(filterset_class=SearchFilter,
                        template_name='question/arama_list.html'),
     name='search'),
 url(r'^comment/(?P<id>[0-9]+)/$',
     views.CommentView.as_view(),
     name="comment"),
 url(r'^comment2/(?P<id>[0-9]+)/$',
     views.Comment2View.as_view(),
     name="comment2"),
 url(r'^qlike/(?P<id>[0-9]+)/$', views.q_like_view, name="qlike"),
 url(r'^qdislike/(?P<id>[0-9]+)/$', views.q_dislike_view, name="qdislike"),
 url(r'^alike/(?P<id>[0-9]+)/$', views.a_like_view, name="alike"),
 url(r'^adislike/(?P<id>[0-9]+)/$', views.a_dislike_view, name="adislike"),
 url(r'^delete/(?P<id>[0-9]+)/(?P<page>[0-9]+)/$',
     views.question_delete_view,
     name="delete"),
 url(r'^adelete/(?P<id>[0-9]+)/(?P<page>[0-9]+)/$',
Exemplo n.º 34
0
from django.conf.urls import url

from django_filters.views import FilterView, object_filter

from .models import Book


def _foo():
    return 'bar'

urlpatterns = [
    url(r'^books-legacy/$', object_filter, {'model': Book, 'extra_context': {'foo': _foo, 'bar': 'foo'}}),
    url(r'^books/$', FilterView.as_view(model=Book)),
]
Exemplo n.º 35
0
         name='applications'),
    path('applications/<int:pk>/detail',
         JobApplicationDetailView.as_view(),
         name='application-details'),
    path('applicant_resume/<int:pk>/',
         ApplicantResumeDetailView.as_view(),
         name='applicant-resume'),
    path('set_interview/<int:id>/', set_interview, name='set-interview'),
    path('select/<int:id>/', select_candidate, name='select'),

    #Client side
    path('<int:pk>/job_detail',
         HomeJobDetailView.as_view(),
         name='home-job-detail'),
    path('message',
         TemplateView.as_view(template_name='job_application/message.html'),
         name='message'),
    url(r'^job_list/$',
        FilterView.as_view(filterset_class=JobListFilterView,
                           template_name='client/job_list.html'),
        name='home-job-list'),
    path('category/<int:pk>/', CategoryJobList.as_view(),
         name='category-jobs'),
    path('applied/', AppliedJobList.as_view(), name='applied-jobs'),
    path('create_resume/', ResumeCreateView.as_view(), name='create-resume'),
    path('resume/<int:pk>/update/',
         ResumeUpdate.as_view(),
         name='resume-update'),
    path('resume/<int:pk>/', ResumeDetailView.as_view(), name='resume'),
]
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', lib_views.about, name='about'),
    path('home/', lib_views.BookListView.as_view(), name='index'),
    # path('book/<int:pk>/', lib_views.BookDetailView.as_view(), name='book-detail'),
    path('book/<int:pk>/', lib_views.BookDetailView, name='book-detail'),
    path('book/new/', lib_views.BookCreateView.as_view(), name='book-create'),
    path('book/<int:pk>/update/',
         lib_views.BookUpdateView.as_view(),
         name='book-update'),
    path('book/<int:pk>/delete/',
         lib_views.BookDeleteView.as_view(),
         name='book-delete'),
    url(r'^search/$',
        FilterView.as_view(filterset_class=BookFilter,
                           template_name='librarian/search_book_list.html'),
        name='search_results'),
    url(r'^search_student/$',
        FilterView.as_view(filterset_class=StudentFilter,
                           template_name='librarian/search_student_list.html'),
        name='search_student'),
    path('student/create/', lib_views.StudentCreate, name='student-create'),
    path('student/', lib_views.StudentList, name='student-list'),
    path('student/<int:pk>/', lib_views.StudentDetail, name='student-detail'),
    path('student<int:pk>/update/',
         lib_views.StudentUpdate,
         name='student-update'),
    path('student/<int:pk>/delete/',
         lib_views.StudentDelete,
         name='student-delete'),
    path('student/book_list',
Exemplo n.º 37
0
 def test_view_without_filterset_or_model(self):
     factory = RequestFactory()
     request = factory.get(self.base_url)
     view = FilterView.as_view()
     with self.assertRaises(ImproperlyConfigured):
         view(request)
Exemplo n.º 38
0
from .filter import UserFilter
app_name = 'User'

urlpatterns = [
    path('', views.home),
    path('scancard', views.scancard),
    path('incorrect', views.incorrect),
    path('menu', views.UserMenu),
    path('menu/withdrawel', views.UserWithdrawel),
    path('menu/withdrawel/processing', views.UserProcessing),
    path('menu/withdrawel/processing/success', views.UserTransact),
    path('menu/rationinfo', views.UserRationinfo),
    path('menu/lasttranaction', views.Userlasttransact),
    path('menu/complain', views.AddComplain),
    path("menu/withdrawel/Insufficienfund", views.insufficient),
    # path('pdftest',views.pdf_view),
    #path('pdftest',views.pdf_view),
    #path('pdftest',views.pdf_view),
    url('search',
        FilterView.as_view(filterset_class=UserFilter,
                           template_name='User/filtering.html'),
        name='search'),
    path("scan", views.scan_rfid),
    path('scan/login', views.login_request),
    # path('config',views.session_demo),
    # path('processing',views.processing),
    # modelforms/person/entry
]

urlpatterns += staticfiles_urlpatterns()
Exemplo n.º 39
0
from django.conf import settings
from django.conf.urls import url, include
from django.contrib import admin
from User.filter import CircularFilter, DistributorFilter, PersonFilter
from django_filters.views import FilterView

app_name = 'Distributor'

urlpatterns = [
    path('login/home/logout', views.logout1),
    path('', views.systemconfig1),
    path('success', views.systemsuccess),
    path('fail', views.systemfail),
    path('home', views.home, name='home'),
    path('home/stock', views.StockDetail),
    path('home/recordentry', views.RecordData),
    path('home/inputentry', views.InputData),
    path('home/update', views.UpdateRecord),
    path('home/complain', views.complainview),
    path('home/inspect', views.Inspectview),
    # path('entry',views.AddEntry),
    path('home/addinput', views.AddInputEntry),
    path('home/addinput/succes', views.inputsucces),
    path('home/circularview',
         FilterView.as_view(filterset_class=CircularFilter,
                            template_name='Distributor/circular_list.html'),
         name='search'),
]

urlpatterns += staticfiles_urlpatterns()
Exemplo n.º 40
0
 def test_view_without_filterset_or_model(self):
     factory = RequestFactory()
     request = factory.get(self.base_url)
     view = FilterView.as_view()
     with self.assertRaises(ImproperlyConfigured):
         view(request)
Exemplo n.º 41
0
    url(r'^create/$', views.AnimalCreateView.as_view(), name='animal_create'),
    url(r'^(?P<pk>\d+)/update/$',
        views.AnimalUpdateView.as_view(),
        name='update_animal'),
    url(r'^feed/$', views.FeedList.as_view(), name='feed_list'),
    url(r'^feed/create/$', views.FeedCreateView.as_view(), name='feed_create'),
    url(r'^feed/(?P<pk>\d+)/$',
        views.FeedDetails.as_view(),
        name='feed_detail'),
    url(r'^types/$', views.AnimalTypeList.as_view(), name='types_list'),
    url(r'^types/(?P<pk>\d+)/$',
        views.AnimalTypeDetail.as_view(),
        name='type_detail'),
    url(r'^types/create/$',
        views.AnimalTypeCreateView.as_view(),
        name='type_create'),
    url(r'^(?P<pk>\d+)/new_comment/$',
        views.CommentAddView.as_view(),
        name='add_comment'),
    url(r'^filter/$',
        FilterView.as_view(filterset_class=AnimalFilter,
                           template_name='search/animal_filter.html'),
        name='filter'),
    url(r'^search/$', views.search, name="search"),
    url(r'^cart/$', CartView.as_view(), name='cart'),
    url(r'^(?P<pk>\d+)/order/$',
        view=AnimalOrderView.as_view(),
        name='animal_order'),
    url(r'^cart/pay/$', CartPayView.as_view(), name='cart_pay'),
]
Exemplo n.º 42
0
    url(r'^api/data/$', views.get_data, name='api-data'),
    url(r'^accueil/$', views.accueil, name='accueil'),
    url(r'^client_create/$', views.client_create, name='client_create'),
    url(r'^client_list/$', views.client_list, name='client_list'),
    url(r'^client_detail/(?P<pk>[0-9]+)/$',
        views.client_detail,
        name='client_detail'),
    #url(r'^client_update/(?P<pk>[0-9]+)/$', views.client_update, name='client_update'),
    url(r'^client/update/(?P<pk>[0-9]+)/$',
        views.UpdateClientView.as_view(),
        name='client_update'),
    url(r'^client_delete/(?P<pk>[0-9]+)/$',
        views.client_delete,
        name='client_delete'),
    url(r'^client_search/$',
        FilterView.as_view(filterset_class=ClientFilter,
                           template_name='plateforme/client_search.html'),
        name='client_search'),
    url(r'^password_reset/$', views.password_reset, name='password_reset'),
    url(r'^password_reset/done/$',
        views.password_reset_done,
        name='password_reset_done'),
    url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        views.password_reset_confirm,
        name='password_reset_confirm'),
    url(r'^reset/done/$',
        views.password_reset_complete,
        name='password_reset_complete'),
    url(r'^admin/', admin.site.urls),

    # Add, Update, Delete Client URLS
    #url(r'^client_list/$', views.ClientList.as_view(), name='client_list'),
Exemplo n.º 43
0
    PostUpdateView,
    PostDeleteView,
    UserPostListView,
    UserFilter,
)
from django_filters.views import FilterView

from . import views
urlpatterns = [
    path('', PostListView.as_view(), name='blog-home'),
    path('user/<str:username>', UserPostListView.as_view(), name='user-posts'),
    path('post/<int:pk>/', PostDetailView.as_view(), name='post-detail'),
    path('post/<int:pk>/', PostDetailView.as_view(), name='post-detail'),
    path('post/<int:pk>/update/', PostUpdateView.as_view(),
         name='post-update'),
    path('post/<int:pk>/delete/', PostDeleteView.as_view(),
         name='post-delete'),
    path('post/new/', PostCreateView.as_view(), name='post-create'),
    path('news/', PostListView.as_view(), name='news'),
    path('about/', views.about, name='blog-about'),
    path('team/', views.Team, name='team'),
    path(r'search/',
         FilterView.as_view(filterset_class=UserFilter,
                            template_name='djangoproject/search_box.html'),
         name='search-blog'),
    path(r'search_review/',
         FilterView.as_view(filterset_class=UserFilter,
                            template_name='djangoproject/search_box_2.html'),
         name='search-blog-review')
]
Exemplo n.º 44
0
from django.conf.urls import patterns, url
from homebrew.views import *
from homebrew.models import *
from django_filters.views import FilterView

urlpatterns = patterns(
    "",
    url(r"^$", index, name="homebrew_index"),
    url(r"^recipes/$", FilterView.as_view(filterset_class=BeerRecipeFilter), name="recipe_home"),
    url(r"^recipes/(?P<homebrew_id>\d+)/$", recipedetails, name="homebrew_details"),
    url(r"^recipes/(?P<homebrew_id>\d+)/update/$", BeerRecipeUpdate.as_view(), name="recipe_update"),
    url(
        r"^recipes/(?P<homebrew_id>\d+)/fermentables/create/$",
        FermentableScheduleCreate.as_view(),
        name="recipe_fermentables_create",
    ),
    url(r"^recipes/(?P<homebrew_id>\d+)/hops/create/$", HopScheduleCreate.as_view(), name="recipe_hops_create"),
    url(
        r"^recipes/(?P<homebrew_id>\d+)/yeastvariant/create/$", YeastVariantCreate.as_view(), name="recipe_yeast_create"
    ),
    url(r"^recipes/create/$", BeerRecipeCreate.as_view(), name="recipe_create"),
    url(r"^yeast/$", FilterView.as_view(filterset_class=YeastTypeFilter), name="yeast_home"),
    url(r"^yeast/create/$", YeastTypeCreate.as_view(), name="yeast_create"),
    url(r"^yeast/(?P<pk>\d+)/$", YeastTypeDetail.as_view(), name="yeast_details"),
    url(r"^hops/$", FilterView.as_view(filterset_class=HopTypeFilter), name="hops_home"),
    url(r"^beers/(?P<beer_id>\d+)/$", beerdetails, name="beer_details"),
    url(r"^beers/(?P<beer_id>\d+)/comment/create/$", beercomment, name="beer_comment"),
)