class ClientView: def __init__(self): self.controller = ClientController() self.movie_view = MovieView() self.reservaion_view = ReservationView() self.projection_view = ProjectionView() self.date_pattern = re.compile(r'^\d\d\d\d-\d\d-\d\d$') def login(self, username, password): self.controller.login_client(username, password) def signup(self, username, password, password_again): # incorrect_password = True # username = input('Username: '******'Enter passoword again: ') # if password == password_comfirm: # incorrect_password = False if password == password_again: return self.controller.create_client(username=username, password=password) else: raise ValueError('Password is not same') def command_2(self): print('You have to enter movie id') print( "If you dont't know the id press 0 and you will see the id for all the movies" ) movie_id = int(input('Enter id: ')) if movie_id == 0: self.movie_view.show_movies() self.command_2() else: print('You can enter a date.In format: year-month-day.') print("If you don't want to enter date press 0") incorrect_date = True while incorrect_date: movie_date = input("Enter date: ") if movie_date == '0': self.projection_view.show_projections(movie_id) incorrect_date = False else: if self.date_pattern.match(movie_date): self.projection_view.show_projections(movie_id, ) incorrect_date = False else: print('Incorrect date') def commands(self, command): if command == 1: self.movie_view.show_movies() if command == 2: self.command_2() if command == 3: self.reservaion_view.make_reservation()
"""pr_rest URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from movies.views import MoviesView, MovieView, PersonsView, PersonView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^movie/(?P<id>\d+)/$', MovieView.as_view(), name='movie'), url(r'^movies$', MoviesView.as_view(), name='movies'), url(r'^person/(?P<id>\d+)/$', PersonView.as_view(), name='person'), url(r'^persons$', PersonsView.as_view(), name='persons'), ]
"""rest URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from movies.views import MoviesView, MovieView, PeopleView, PersonView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^movies$', MoviesView.as_view(), name='movies'), url(r'^movies/(?P<pk>(\d)+)$', MovieView.as_view(), name='movies_id'), url(r'^people$', PeopleView.as_view(), name='people'), url(r'^people/(?P<pk>(\d)+)$', PersonView.as_view(), name='person_id'), ]
"""smithee URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path from movies.views import MovieView, ProducerView from movies.views import custom_handler404 handler404 = custom_handler404 urlpatterns = [ path('', MovieView.as_view()), path('producers/', ProducerView.as_view()), path('producers/<int:year>/', ProducerView.as_view()), path('admin/', admin.site.urls), ]
"""studio_ghibli URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.views.decorators.cache import cache_page from django.urls import path, include, re_path from movies.views import NotFound, MovieView from constants import CACHE_TIMEOUT urlpatterns = [ path('movies/', cache_page(CACHE_TIMEOUT)(MovieView.as_view()), name='Studio'), re_path(r'(?s).*', NotFound.as_view(), name='Error'), ]
"""REST_Server URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from movies.views import MoviesView, MovieView, PersonsView, PersonView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^movies/$', MoviesView.as_view(), name='movies'), url(r'^movies/(?P<id>(\d)+)', MovieView.as_view(), name='movies'), url(r'^persons/$', PersonsView.as_view(), name='persons'), url(r'^persons/(?P<id>(\d)+)', PersonView.as_view(), name='movie') ]
def __init__(self): self.controller = ClientController() self.movie_view = MovieView() self.reservaion_view = ReservationView() self.projection_view = ProjectionView() self.date_pattern = re.compile(r'^\d\d\d\d-\d\d-\d\d$')
"""rest_movies URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from movies.views import MovieView, MoviesView, PeopleView, PersonView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^movies$', MoviesView.as_view(), name='movies'), url(r'^movies/(?P<id>(\d+))$', MovieView.as_view(), name="movie"), url(r'^people$', PeopleView.as_view(), name='people'), url(r'^people/(?P<id>(\d+))$', PersonView.as_view(), name="person") ]
def show_all_movies(self): temp_movie_admin = MovieView() temp_movie_admin.show_all_movies()
def edit_movie(self): temp_movie_admin = MovieView() temp_movie_admin.edit_movie()
def add_movie(self): temp_movie_admin = MovieView() temp_movie_admin.add_movie()
"""REST_Server URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from movies.views import MovieView, MoviesView, PersonView, PersonsView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^movies/$', MoviesView.as_view(), name='movies-all'), url(r'^movie/(?P<id>(\d)+)$', MovieView.as_view(), name='movie-details'), url(r'^persons/$', PersonsView.as_view(), name='persons-all'), url(r'^person/(?P<id>(\d)+)$', PersonView.as_view(), name='person-details'), ]
"""goodoldmovies URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.urls import path from movies.views import MovieView, MainPageView urlpatterns = [ # path('', MovieView.as_view()), # path("movies/", MainPageView.as_view()), path("", MainPageView.as_view()), path("movies/<str:movie_name>/", MovieView.as_view()), ]
from django.urls import path from movies.views import MovieView, index, MovieDetailView, AddReview, ActorView, FilterMoviesView, AddStarRating, SearchFilm, SearchActor urlpatterns = [ path('movies-list/', MovieView.as_view(), name='movies-list'), path('movies-list/add-rating/', AddStarRating.as_view(), name='add_rating'), path('movies-list/searchfilm/', SearchFilm.as_view(), name='search_film'), path('movies-list/searchactor', SearchActor.as_view(), name='search_actor'), path('movies-list/filter-yrge/', FilterMoviesView.as_view(), name='filter-yrge'), path('movies-list/<slug:slug>', MovieDetailView.as_view(), name='movies-detail'), path('movies-list/review/<int:pk>', AddReview.as_view(), name='add_review'), path('movies-list/actor/<str:slug>', ActorView.as_view(), name='actor_detail'), ]
"""REST_API URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from movies.views import MoviesView, MovieView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^movies/$', MoviesView.as_view()), url(r'^movies/(?P<id>\d+)', MovieView.as_view()), ]
"""mod6 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from movies.views import MoviesView, MovieView, PersonView, PersonsView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^movies/$', MoviesView.as_view(), name='movies'), url(r'^movies/(?P<pk>\d+)/$', MovieView.as_view(), name='movie-detail'), url(r'^persons/$', PersonsView.as_view(), name='person'), url(r'^persons/(?P<pk>\d+)/$', PersonView.as_view(), name='person-detail'), ]
def delete_movie(self): temp_movie_admin = MovieView() temp_movie_admin.delete_movie()
from django.urls import path, include from movies.views import movie_view, movie_html_view, MovieView urlpatterns = [ path('', movie_view), path('memento/', movie_html_view), path('api/', MovieView.as_view()), ]
"""rest URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path from movies.views import (MoviesView, MovieView, PeopleView, PersonView) urlpatterns = [ path('admin/', admin.site.urls), path('movies/', MoviesView.as_view(), name='all_movies'), path('movie/<int:id>/', MovieView.as_view(), name='movie'), path('people/', PeopleView.as_view(), name='people'), path('person/<int:id>/', PersonView.as_view(), name='person'), ]
"""w_rest URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from movies.views import MoviesView, MovieView, PersonsView, PersonView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^movies/$', MoviesView.as_view()), url(r'^movies/(?P<id>(\d)+)', MovieView.as_view()), url(r'^persons/$', PersonsView.as_view()), url(r'^persons/(?P<id>(\d)+)', PersonView.as_view()), ]
"""warsztaty6 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from movies.views import MoviesView, MovieView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^movies', MoviesView.as_view(), name='movies'), url(r'^movie/(?P<movie_id>(\d)+)', MovieView.as_view()), ]
"""Django URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from movies.views import MoviesView, MovieView urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^movies/$', MoviesView.as_view(), name="movies"), url(r'^movies/(?P<movie_id>(\d)+)', MovieView.as_view(), name="movie"), ]
from django.contrib import admin from django.urls import path from movies.views import MovieView, MainPageView, MainView, AboutView urlpatterns = [ path('', MainView.as_view()), path('about/', AboutView.as_view()), path('movies/', MainPageView.as_view()), path('movies/<str:movie_name>/', MovieView.as_view()), path('admin/', admin.site.urls), ]
from django.urls import path from movies.views import MovieView, SpecificMovieView app_name = 'movies' urlpatterns = [ path('', MovieView.as_view(), name='list'), path("<int:pk>/", SpecificMovieView.as_view(), name='details') ]
"""work6 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path from movies.views import MoviesView, MovieView, PersonView, PersonsView, AssignDirectorMovie, dziwnyWidok urlpatterns = [ path('admin/', admin.site.urls), path('movies', MoviesView.as_view()), path('movies/<int:id>', MovieView.as_view()), path('persons/<int:id>', PersonView.as_view()), path('persons/', PersonsView.as_view()), path('movies/<int:movie_id>/director/<int:person_id>', AssignDirectorMovie.as_view()), path('s', dziwnyWidok), ]
"""REST_movies URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url from django.contrib import admin from movies.views import MovieView, MoviesView, PeopleView, PersonView urlpatterns = [ url(r'^admin/$', admin.site.urls), url(r'^movies/$', MoviesView.as_view()), url(r'^movie/(?P<id>(\d)+)/$', MovieView.as_view()), url(r'^people/$', PeopleView.as_view()), url(r'^person/(?P<id>(\d)+)/$', PersonView.as_view()), ]
from django.urls import path,include from movies.views import HomeView, BrowseView, MovieView from . import views app_name = 'movies' urlpatterns = [ path('', HomeView.as_view(), name='home'), path('home', HomeView.as_view()), path('browse', BrowseView.as_view(), name='browse'), path('movie/<int:pk>', MovieView.as_view(), name='movie'), ]