Skip to content

Commit 8d13461

Browse files
db tables & python+Django config
1 parent 057be5f commit 8d13461

File tree

376 files changed

+122558
-45
lines changed

Some content is hidden

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

376 files changed

+122558
-45
lines changed

Mint/.ropeproject/config.py

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# The default ``config.py``
2+
# flake8: noqa
3+
4+
5+
def set_prefs(prefs):
6+
"""This function is called before opening the project"""
7+
8+
# Specify which files and folders to ignore in the project.
9+
# Changes to ignored resources are not added to the history and
10+
# VCSs. Also they are not returned in `Project.get_files()`.
11+
# Note that ``?`` and ``*`` match all characters but slashes.
12+
# '*.pyc': matches 'test.pyc' and 'pkg/test.pyc'
13+
# 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc'
14+
# '.svn': matches 'pkg/.svn' and all of its children
15+
# 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o'
16+
# 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o'
17+
prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject',
18+
'.hg', '.svn', '_svn', '.git', '.tox']
19+
20+
# Specifies which files should be considered python files. It is
21+
# useful when you have scripts inside your project. Only files
22+
# ending with ``.py`` are considered to be python files by
23+
# default.
24+
# prefs['python_files'] = ['*.py']
25+
26+
# Custom source folders: By default rope searches the project
27+
# for finding source folders (folders that should be searched
28+
# for finding modules). You can add paths to that list. Note
29+
# that rope guesses project source folders correctly most of the
30+
# time; use this if you have any problems.
31+
# The folders should be relative to project root and use '/' for
32+
# separating folders regardless of the platform rope is running on.
33+
# 'src/my_source_folder' for instance.
34+
# prefs.add('source_folders', 'src')
35+
36+
# You can extend python path for looking up modules
37+
# prefs.add('python_path', '~/python/')
38+
39+
# Should rope save object information or not.
40+
prefs['save_objectdb'] = True
41+
prefs['compress_objectdb'] = False
42+
43+
# If `True`, rope analyzes each module when it is being saved.
44+
prefs['automatic_soa'] = True
45+
# The depth of calls to follow in static object analysis
46+
prefs['soa_followed_calls'] = 0
47+
48+
# If `False` when running modules or unit tests "dynamic object
49+
# analysis" is turned off. This makes them much faster.
50+
prefs['perform_doa'] = True
51+
52+
# Rope can check the validity of its object DB when running.
53+
prefs['validate_objectdb'] = True
54+
55+
# How many undos to hold?
56+
prefs['max_history_items'] = 32
57+
58+
# Shows whether to save history across sessions.
59+
prefs['save_history'] = True
60+
prefs['compress_history'] = False
61+
62+
# Set the number spaces used for indenting. According to
63+
# :PEP:`8`, it is best to use 4 spaces. Since most of rope's
64+
# unit-tests use 4 spaces it is more reliable, too.
65+
prefs['indent_size'] = 4
66+
67+
# Builtin and c-extension modules that are allowed to be imported
68+
# and inspected by rope.
69+
prefs['extension_modules'] = []
70+
71+
# Add all standard c-extensions to extension_modules list.
72+
prefs['import_dynload_stdmods'] = True
73+
74+
# If `True` modules with syntax errors are considered to be empty.
75+
# The default value is `False`; When `False` syntax errors raise
76+
# `rope.base.exceptions.ModuleSyntaxError` exception.
77+
prefs['ignore_syntax_errors'] = False
78+
79+
# If `True`, rope ignores unresolvable imports. Otherwise, they
80+
# appear in the importing namespace.
81+
prefs['ignore_bad_imports'] = False
82+
83+
# If `True`, rope will insert new module imports as
84+
# `from <package> import <module>` by default.
85+
prefs['prefer_module_from_imports'] = False
86+
87+
# If `True`, rope will transform a comma list of imports into
88+
# multiple separate import statements when organizing
89+
# imports.
90+
prefs['split_imports'] = False
91+
92+
# If `True`, rope will remove all top-level import statements and
93+
# reinsert them at the top of the module when making changes.
94+
prefs['pull_imports_to_top'] = True
95+
96+
# If `True`, rope will sort imports alphabetically by module name instead
97+
# of alphabetically by import statement, with from imports after normal
98+
# imports.
99+
prefs['sort_imports_alphabetically'] = False
100+
101+
# Location of implementation of
102+
# rope.base.oi.type_hinting.interfaces.ITypeHintingFactory In general
103+
# case, you don't have to change this value, unless you're an rope expert.
104+
# Change this value to inject you own implementations of interfaces
105+
# listed in module rope.base.oi.type_hinting.providers.interfaces
106+
# For example, you can add you own providers for Django Models, or disable
107+
# the search type-hinting in a class hierarchy, etc.
108+
prefs['type_hinting_factory'] = (
109+
'rope.base.oi.type_hinting.factory.default_type_hinting_factory')
110+
111+
112+
def project_opened(project):
113+
"""This function is called after opening the project"""
114+
# Do whatever you like here!

Mint/Mint/__init__.py

Whitespace-only changes.

Mint/Mint/settings.py

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
"""
2+
Django settings for Mint project.
3+
4+
Generated by 'django-admin startproject' using Django 2.2.2.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/2.2/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/2.2/ref/settings/
11+
"""
12+
13+
import os
14+
15+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17+
18+
19+
# Quick-start development settings - unsuitable for production
20+
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
21+
22+
# SECURITY WARNING: keep the secret key used in production secret!
23+
SECRET_KEY = 'h!_rqnc8*^fzk-9i$=dxyj%&kp5=^d93+(-=q2nf35s=owlu8e'
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = True
27+
28+
ALLOWED_HOSTS = []
29+
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+
'catalogo',
41+
]
42+
43+
MIDDLEWARE = [
44+
'django.middleware.security.SecurityMiddleware',
45+
'django.contrib.sessions.middleware.SessionMiddleware',
46+
'django.middleware.common.CommonMiddleware',
47+
'django.middleware.csrf.CsrfViewMiddleware',
48+
'django.contrib.auth.middleware.AuthenticationMiddleware',
49+
'django.contrib.messages.middleware.MessageMiddleware',
50+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
51+
]
52+
53+
ROOT_URLCONF = 'Mint.urls'
54+
55+
TEMPLATES = [
56+
{
57+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
58+
'DIRS': [],
59+
'APP_DIRS': True,
60+
'OPTIONS': {
61+
'context_processors': [
62+
'django.template.context_processors.debug',
63+
'django.template.context_processors.request',
64+
'django.contrib.auth.context_processors.auth',
65+
'django.contrib.messages.context_processors.messages',
66+
],
67+
},
68+
},
69+
]
70+
71+
WSGI_APPLICATION = 'Mint.wsgi.application'
72+
73+
74+
# Database
75+
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
76+
77+
DATABASES = {
78+
'default': {
79+
'ENGINE': 'django.db.backends.sqlite3',
80+
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
81+
}
82+
}
83+
84+
85+
# Password validation
86+
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
87+
88+
AUTH_PASSWORD_VALIDATORS = [
89+
{
90+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
91+
},
92+
{
93+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
94+
},
95+
{
96+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
97+
},
98+
{
99+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
100+
},
101+
]
102+
103+
104+
# Internationalization
105+
# https://docs.djangoproject.com/en/2.2/topics/i18n/
106+
107+
LANGUAGE_CODE = 'es-es'
108+
109+
TIME_ZONE = 'UTC'
110+
111+
# USE_I18N = True
112+
#
113+
# USE_L10N = True
114+
#
115+
# USE_TZ = True
116+
117+
118+
# Static files (CSS, JavaScript, Images)
119+
# https://docs.djangoproject.com/en/2.2/howto/static-files/
120+
121+
STATIC_URL = '/static/'

Mint/Mint/urls.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""Mint URL Configuration
2+
3+
The `urlpatterns` list routes URLs to views. For more information please see:
4+
https://docs.djangoproject.com/en/2.2/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+
17+
from django.contrib import admin
18+
from django.urls import path, include # modificada
19+
20+
urlpatterns = [
21+
path('', include("catalogo.urls")), # agregada
22+
path('admin/', admin.site.urls),
23+
]

Mint/Mint/wsgi.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for Mint 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/2.2/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', 'Mint.settings')
15+
16+
application = get_wsgi_application()

Mint/catalogo/admin.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from django.contrib import admin
2+
from .models import productos, subcategorias, categorias, Pedido_Detalle
3+
4+
# Register your models here.
5+
admin.site.register(productos)
6+
7+
#
8+
# class ProductosAdmin(admin.ModelAdmin):
9+
# # Se sobre escribe lo que hace __str__
10+
# list_display = ("marca", "modelo", "talla", "cantidad",
11+
# "nombre", "precio", "imagen", "categoria", "subcategoria")
12+
# admin.site.register(Productos, ProductosAdmin)
13+
14+
15+
# class SubcategoriasAdmin(admin.ModelAdmin):
16+
# list_display = ("nombre", "imagen")
17+
# admin.site.register(Subcategorias, SubcategoriasAdmin)
18+
#
19+
# class CategoriasAdmin(admin.ModelAdmin):
20+
# list_display = ("nombre", "imagen")
21+
# admin.site.register(Categorias, CategoriasAdmin)
22+
#
23+
# class Pedido_Detalle(admin.ModelAdmin):
24+
# list_display = ("cantidad", "subtotal", "pedido", "producto")
25+
# admin.site.register(Pedido_Detalle, Pedido_DetalleAdmin)

Mint/catalogo/apps.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class CatalogoConfig(AppConfig):
5+
name = 'catalogo'
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 2.2.3 on 2019-07-06 02:33
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
initial = True
9+
10+
dependencies = [
11+
]
12+
13+
operations = [
14+
migrations.CreateModel(
15+
name='Usuario',
16+
fields=[
17+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18+
('genero', models.CharField(choices=[('M', 'Mujer'), ('H', 'Hombre')], max_length=1)),
19+
('direccion', models.CharField(blank=True, max_length=256, null=True)),
20+
],
21+
),
22+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Generated by Django 2.2.3 on 2019-07-06 02:40
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('catalogo', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.CreateModel(
14+
name='Catalog',
15+
fields=[
16+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
17+
('name', models.CharField(max_length=255)),
18+
('slug', models.SlugField(max_length=150)),
19+
('publisher', models.CharField(max_length=300)),
20+
('description', models.TextField()),
21+
],
22+
),
23+
migrations.CreateModel(
24+
name='Product',
25+
fields=[
26+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
27+
('name', models.CharField(max_length=300)),
28+
('slug', models.SlugField(max_length=150)),
29+
('description', models.TextField()),
30+
('manufacturer', models.CharField(blank=True, max_length=300)),
31+
('price_in_dollars', models.DecimalField(decimal_places=2, max_digits=6)),
32+
],
33+
),
34+
migrations.DeleteModel(
35+
name='Usuario',
36+
),
37+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Generated by Django 2.2.3 on 2019-07-06 02:51
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('catalogo', '0002_auto_20190706_0240'),
11+
]
12+
13+
operations = [
14+
migrations.AlterField(
15+
model_name='product',
16+
name='name',
17+
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='catalogo.Catalog'),
18+
),
19+
]

0 commit comments

Comments
 (0)