Skip to content

Commit 176d2e5

Browse files
Sobreescriturdel metodo post
1 parent c45da75 commit 176d2e5

File tree

308 files changed

+347361
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+347361
-0
lines changed

.gitignore

Whitespace-only changes.

24_Sobreescritura_del_metodo_post/.idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

24_Sobreescritura_del_metodo_post/.idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

24_Sobreescritura_del_metodo_post/.idea/24_Sobreescritura_del_metodo_post.iml

+28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

24_Sobreescritura_del_metodo_post/.idea/inspectionProfiles/profiles_settings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

24_Sobreescritura_del_metodo_post/.idea/misc.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

24_Sobreescritura_del_metodo_post/.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

24_Sobreescritura_del_metodo_post/.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--Borrar las tablas de PostgreSQL
2+
3+
delete from erp_product;
4+
ALTER SEQUENCE erp_product_id_seq RESTART WITH 1;
5+
delete from erp_category;
6+
ALTER SEQUENCE erp_category_id_seq RESTART WITH 1;
7+
8+
Links de datatable
9+
10+
https://datatables.net/download/
11+
https://datatables.net/examples/styling/bootstrap4
12+
https://datatables.net/extensions/fixedheader/examples/styling/bootstrap4.html
13+
https://datatables.net/examples/basic_init/language.html
14+
http://cdn.datatables.net/plug-ins/1.10.20/i18n/Spanish.json
15+
https://datatables.net/examples/basic_init/zero_configuration.html
16+
17+
Código para poder ejecutar
18+
19+
<link rel="stylesheet" href="{% static 'lib/datatables-1.10.20/css/dataTables.bootstrap4.min.css' %}"/>
20+
<link rel="stylesheet" href="{% static 'lib/datatables-1.10.20/plugins/responsive-2.2.3/css/responsive.bootstrap4.min.css' %}"/>
21+
<script src="{% static 'lib/datatables-1.10.20/js/jquery.dataTables.js' %}"></script>
22+
<script src="{% static 'lib/datatables-1.10.20/js/dataTables.bootstrap4.min.js' %}"></script>
23+
<script src="{% static 'lib/datatables-1.10.20/plugins/responsive-2.2.3/js/dataTables.responsive.min.js' %}"></script>
24+
<script src="{% static 'lib/datatables-1.10.20/plugins/responsive-2.2.3/js/responsive.bootstrap4.min.js' %}"></script>
25+
26+
$('#data').DataTable({
27+
responsive: true,
28+
autoWidth: false
29+
});
30+
31+
Cambiar el idioma
32+
33+
"language": {
34+
url : '{% static 'lib/datatables-1.10.20/spanish.txt' %}'
35+
}

24_Sobreescritura_del_metodo_post/Implementando_decoradores/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for ListView_II_Vistas basadas en clases project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Implementando_decoradores.settings')
15+
16+
application = get_asgi_application()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import os
2+
import sys
3+
import time
4+
5+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
6+
7+
SQLITE = {
8+
'default': {
9+
'ENGINE': 'django.db.backends.sqlite3',
10+
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
11+
}
12+
}
13+
14+
15+
#MARIADB = {
16+
# 'default': {
17+
# 'ENGINE': 'django.db.backends.mysql',
18+
# 'NAME': 'db',
19+
# 'USER': 'briandb',
20+
# 'PASSWORD': 'briandb',
21+
# 'HOST': '127.0.0.1',
22+
# 'PORT': 3307,
23+
# }
24+
#}
25+
26+
27+
POSTGRES = {
28+
'default': {
29+
'ENGINE': 'django.db.backends.postgresql_psycopg2',
30+
'NAME': 'db',
31+
'USER': 'briandb',
32+
'PASSWORD': 'briandb',
33+
'HOST': '127.0.0.1',
34+
'DATABASE_PORT': '5432',
35+
}
36+
}
37+
38+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
"""
2+
Django settings for ListView_II_Vistas basadas en clases project.
3+
4+
Generated by 'django-admin startproject' using Django 3.1.7.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.0/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/3.0/ref/settings/
11+
"""
12+
13+
import os
14+
15+
import Implementando_decoradores.db as db
16+
17+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
18+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
19+
20+
# Quick-start development settings - unsuitable for production
21+
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
22+
23+
# SECURITY WARNING: keep the secret key used in production secret!
24+
SECRET_KEY = 'fd&a%**+le-74cq&mrlh^a0yp95!n5vf-q5u3+5f*9=6at1c2^'
25+
26+
# SECURITY WARNING: don't run with debug turned on in production!
27+
DEBUG = True
28+
29+
ALLOWED_HOSTS = []
30+
31+
# Application definition
32+
33+
INSTALLED_APPS = [
34+
'django.contrib.admin',
35+
'django.contrib.auth',
36+
'django.contrib.contenttypes',
37+
'django.contrib.sessions',
38+
'django.contrib.messages',
39+
'django.contrib.staticfiles',
40+
# Apps
41+
'core.erp'
42+
]
43+
44+
MIDDLEWARE = [
45+
'django.middleware.security.SecurityMiddleware',
46+
'django.contrib.sessions.middleware.SessionMiddleware',
47+
'django.middleware.common.CommonMiddleware',
48+
'django.middleware.csrf.CsrfViewMiddleware',
49+
'django.contrib.auth.middleware.AuthenticationMiddleware',
50+
'django.contrib.messages.middleware.MessageMiddleware',
51+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
52+
]
53+
54+
ROOT_URLCONF = 'Implementando_decoradores.urls'
55+
56+
TEMPLATES = [
57+
{
58+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
59+
'DIRS': [os.path.join(BASE_DIR, 'templates')],
60+
'APP_DIRS': True,
61+
'OPTIONS': {
62+
'context_processors': [
63+
'django.template.context_processors.debug',
64+
'django.template.context_processors.request',
65+
'django.contrib.auth.context_processors.auth',
66+
'django.contrib.messages.context_processors.messages',
67+
],
68+
},
69+
},
70+
]
71+
72+
WSGI_APPLICATION = 'Implementando_decoradores.wsgi.application'
73+
74+
# Database
75+
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
76+
77+
#DATABASES = db.MARIADB
78+
DATABASES = db.POSTGRES
79+
80+
81+
82+
# Password validation
83+
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
84+
85+
AUTH_PASSWORD_VALIDATORS = [
86+
{
87+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
88+
},
89+
{
90+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
91+
},
92+
{
93+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
94+
},
95+
{
96+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
97+
},
98+
]
99+
100+
# Internationalization
101+
# https://docs.djangoproject.com/en/3.0/topics/i18n/
102+
103+
LANGUAGE_CODE = 'en-us'
104+
105+
TIME_ZONE = 'UTC'
106+
107+
USE_I18N = True
108+
109+
USE_L10N = True
110+
111+
USE_TZ = True
112+
113+
# Static files (CSS, JavaScript, Images)
114+
# https://docs.djangoproject.com/en/3.0/howto/static-files/
115+
116+
STATIC_URL = '/static/'
117+
118+
STATICFILES_DIRS = [
119+
os.path.join(BASE_DIR, "static"),
120+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""app URL Configuration
2+
3+
The `urlpatterns` list routes URLs to views. For more information please see:
4+
https://docs.djangoproject.com/en/3.0/topics/http/urls/
5+
Examples:
6+
Function views
7+
1. Add an import: from my_app import views
8+
2. Add a URL to urlpatterns: path('', views.home, name='home')
9+
Class-based views
10+
1. Add an import: from other_app.views import Home
11+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12+
Including another URLconf
13+
1. Import the include() function: from django.urls import include, path
14+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15+
"""
16+
from django.contrib import admin
17+
from django.urls import path, include
18+
19+
urlpatterns = [
20+
path('admin/', admin.site.urls),
21+
path('erp/', include('core.erp.urls'))
22+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for config project.
3+
4+
It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.wsgi import get_wsgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Implementando_decoradores.settings')
15+
16+
application = get_wsgi_application()

24_Sobreescritura_del_metodo_post/core/erp/__init__.py

Whitespace-only changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.contrib import admin
2+
from core.erp.models import *
3+
4+
# Register your models here.
5+
admin.site.register(Category)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class ErpConfig(AppConfig):
5+
name = 'erp'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
gender_choices = (
2+
('male','Masculino'),
3+
('female','Femenino'),
4+
)

0 commit comments

Comments
 (0)