-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93e242f
commit 873bee1
Showing
35 changed files
with
1,378 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
""" | ||
Django settings for biblioteca project. | ||
Generated by 'django-admin startproject' using Django 2.0.4. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/2.0/topics/settings/ | ||
For the full list of settings and their values, see | ||
https://docs.djangoproject.com/en/2.0/ref/settings/ | ||
""" | ||
|
||
import os | ||
|
||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) | ||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
|
||
|
||
# Quick-start development settings - unsuitable for production | ||
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ | ||
|
||
# SECURITY WARNING: keep the secret key used in production secret! | ||
SECRET_KEY = 'a#ectq**sn3^c3r5%lir^16&)aq6kzn5x#j!l&tg6y1y1b1m%y' | ||
|
||
# SECURITY WARNING: don't run with debug turned on in production! | ||
DEBUG = True | ||
|
||
ALLOWED_HOSTS = [] | ||
|
||
|
||
# Application definition | ||
|
||
INSTALLED_APPS = [ | ||
'controle', | ||
'django.contrib.admin', | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'django.contrib.sessions', | ||
'django.contrib.messages', | ||
'django.contrib.staticfiles', | ||
] | ||
|
||
MIDDLEWARE = [ | ||
'django.middleware.security.SecurityMiddleware', | ||
'django.contrib.sessions.middleware.SessionMiddleware', | ||
'django.middleware.common.CommonMiddleware', | ||
'django.middleware.csrf.CsrfViewMiddleware', | ||
'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
'django.contrib.messages.middleware.MessageMiddleware', | ||
'django.middleware.clickjacking.XFrameOptionsMiddleware', | ||
] | ||
|
||
ROOT_URLCONF = 'biblioteca.urls' | ||
|
||
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': [], | ||
'APP_DIRS': True, | ||
'OPTIONS': { | ||
'context_processors': [ | ||
'django.template.context_processors.debug', | ||
'django.template.context_processors.request', | ||
'django.contrib.auth.context_processors.auth', | ||
'django.contrib.messages.context_processors.messages', | ||
], | ||
}, | ||
}, | ||
] | ||
|
||
WSGI_APPLICATION = 'biblioteca.wsgi.application' | ||
|
||
|
||
# Database | ||
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), | ||
} | ||
} | ||
|
||
|
||
# Password validation | ||
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators | ||
|
||
AUTH_PASSWORD_VALIDATORS = [ | ||
{ | ||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', | ||
}, | ||
{ | ||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', | ||
}, | ||
{ | ||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', | ||
}, | ||
{ | ||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', | ||
}, | ||
] | ||
|
||
|
||
# Internationalization | ||
# https://docs.djangoproject.com/en/2.0/topics/i18n/ | ||
|
||
LANGUAGE_CODE = 'en-us' | ||
|
||
TIME_ZONE = 'UTC' | ||
|
||
USE_I18N = True | ||
|
||
USE_L10N = True | ||
|
||
USE_TZ = True | ||
|
||
|
||
# Static files (CSS, JavaScript, Images) | ||
# https://docs.djangoproject.com/en/2.0/howto/static-files/ | ||
|
||
STATIC_URL = '/static/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"""biblioteca 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, include | ||
|
||
urlpatterns = [ | ||
path('admin/', admin.site.urls), | ||
path('', include('controle.urls')), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
WSGI config for biblioteca project. | ||
It exposes the WSGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ | ||
""" | ||
|
||
import os | ||
|
||
from django.core.wsgi import get_wsgi_application | ||
|
||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "biblioteca.settings") | ||
|
||
application = get_wsgi_application() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from django.contrib import admin | ||
from .models import * | ||
|
||
admin.site.register(Cliente) | ||
admin.site.register(Funcionario) | ||
admin.site.register(Livros) | ||
admin.site.register(Processo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class ControleConfig(AppConfig): | ||
name = 'controle' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from django import forms | ||
from .models import Cliente | ||
from .models import Funcionario | ||
from .models import Livros | ||
from .models import Processo | ||
|
||
|
||
class ClienteForm(forms.ModelForm): | ||
class Meta: | ||
model=Cliente | ||
fields="__all__" | ||
|
||
|
||
class FuncionarioForm(forms.ModelForm): | ||
class Meta: | ||
model=Funcionario | ||
fields="__all__" | ||
|
||
class LivrosForm(forms.ModelForm): | ||
class Meta: | ||
model=Livros | ||
fields="__all__" | ||
|
||
class ProcessoForm(forms.ModelForm): | ||
class Meta: | ||
model=Processo | ||
fields="__all__" | ||
|
||
class BuscaForm(forms.Form): | ||
nome = forms.CharField(max_length=255) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Generated by Django 2.0.4 on 2018-05-23 00:09 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Cliente', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('nome_text', models.CharField(max_length=255)), | ||
('CPF_cliente', models.IntegerField(default=0)), | ||
('Tel_cliente', models.IntegerField(default=0)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Funcionario', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('id_funcionario', models.IntegerField(default=0)), | ||
('nome_text', models.CharField(max_length=255)), | ||
('CPF_cliente', models.IntegerField(default=0)), | ||
('Tel_cliente', models.IntegerField(default=0)), | ||
('Cargo_Func', models.CharField(max_length=200)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Livros', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('id_livro', models.IntegerField(default=0)), | ||
('nome_livro', models.CharField(max_length=255)), | ||
('descricao_livro', models.CharField(max_length=200)), | ||
('quantidade_paginas', models.IntegerField(default=0)), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Generated by Django 2.0.4 on 2018-06-05 22:28 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('controle', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='cliente', | ||
old_name='nome_text', | ||
new_name='nome_Cliente', | ||
), | ||
migrations.RenameField( | ||
model_name='funcionario', | ||
old_name='nome_text', | ||
new_name='nome_Funcionario', | ||
), | ||
migrations.RemoveField( | ||
model_name='funcionario', | ||
name='id_funcionario', | ||
), | ||
migrations.RemoveField( | ||
model_name='livros', | ||
name='id_livro', | ||
), | ||
migrations.AlterField( | ||
model_name='cliente', | ||
name='CPF_cliente', | ||
field=models.CharField(max_length=255), | ||
), | ||
migrations.AlterField( | ||
model_name='cliente', | ||
name='Tel_cliente', | ||
field=models.CharField(max_length=255), | ||
), | ||
migrations.AlterField( | ||
model_name='funcionario', | ||
name='CPF_cliente', | ||
field=models.CharField(max_length=255), | ||
), | ||
migrations.AlterField( | ||
model_name='funcionario', | ||
name='Tel_cliente', | ||
field=models.CharField(max_length=255), | ||
), | ||
migrations.AlterField( | ||
model_name='livros', | ||
name='quantidade_paginas', | ||
field=models.CharField(max_length=255), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Generated by Django 2.0.4 on 2018-06-05 23:44 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('controle', '0002_auto_20180605_2228'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='cliente', | ||
old_name='CPF_cliente', | ||
new_name='cpf', | ||
), | ||
migrations.RenameField( | ||
model_name='cliente', | ||
old_name='Tel_cliente', | ||
new_name='nome', | ||
), | ||
migrations.RenameField( | ||
model_name='cliente', | ||
old_name='nome_Cliente', | ||
new_name='telefone', | ||
), | ||
migrations.RenameField( | ||
model_name='funcionario', | ||
old_name='Cargo_Func', | ||
new_name='Cargo', | ||
), | ||
migrations.RenameField( | ||
model_name='funcionario', | ||
old_name='CPF_cliente', | ||
new_name='Telefone', | ||
), | ||
migrations.RenameField( | ||
model_name='funcionario', | ||
old_name='Tel_cliente', | ||
new_name='cpf', | ||
), | ||
migrations.RenameField( | ||
model_name='funcionario', | ||
old_name='nome_Funcionario', | ||
new_name='nome', | ||
), | ||
migrations.RenameField( | ||
model_name='livros', | ||
old_name='descricao_livro', | ||
new_name='descricao', | ||
), | ||
migrations.RenameField( | ||
model_name='livros', | ||
old_name='nome_livro', | ||
new_name='nome', | ||
), | ||
migrations.RenameField( | ||
model_name='livros', | ||
old_name='quantidade_paginas', | ||
new_name='quantidade', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 2.0.4 on 2018-06-05 23:45 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('controle', '0003_auto_20180605_2344'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='funcionario', | ||
old_name='Cargo', | ||
new_name='cargo', | ||
), | ||
migrations.RenameField( | ||
model_name='funcionario', | ||
old_name='Telefone', | ||
new_name='telefone', | ||
), | ||
] |
Oops, something went wrong.