Skip to content

back nuevo y completo para usar con web y app #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added backend/ricco/media/products/bur12.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/ricco/media/products/bur2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/ricco/media/products/bur8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified backend/ricco/ricco/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file modified backend/ricco/ricco/__pycache__/settings.cpython-311.pyc
Binary file not shown.
Binary file modified backend/ricco/ricco/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file modified backend/ricco/ricco/__pycache__/wsgi.cpython-311.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion backend/ricco/ricco/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
'ENGINE': 'django.db.backends.mysql',
'NAME': 'abm_ispc',
'USER': 'root',
'PASSWORD': '1234',
'PASSWORD': '12345',
'HOST': 'localhost',
'PORT': '3306',
'OPTIONS': {
Expand Down
Binary file modified backend/ricco/ricco_app/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file modified backend/ricco/ricco_app/__pycache__/admin.cpython-311.pyc
Binary file not shown.
Binary file modified backend/ricco/ricco_app/__pycache__/apps.cpython-311.pyc
Binary file not shown.
Binary file modified backend/ricco/ricco_app/__pycache__/models.cpython-311.pyc
Binary file not shown.
Binary file modified backend/ricco/ricco_app/__pycache__/serializers.cpython-311.pyc
Binary file not shown.
Binary file modified backend/ricco/ricco_app/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file modified backend/ricco/ricco_app/__pycache__/views.cpython-311.pyc
Binary file not shown.
22 changes: 11 additions & 11 deletions backend/ricco/ricco_app/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin

from .models import Localidad
from .models import Barrio
# from .models import Localidad
# from .models import Barrio
from .models import Rol
from .models import Producto
from .models import Direccion
Expand All @@ -28,15 +28,15 @@ class CustomUserAdmin(UserAdmin):
'fields': ('email', 'password1', 'password2'),
}),
)
list_display = ('email', 'first_name', 'last_name', 'is_staff', Rol)
list_display = ('email', 'first_name', 'last_name', 'is_staff', 'rol')
search_fields = ('email', 'first_name', 'last_name', 'nombre_rol')
ordering = ('email',)

class LocalidadAdmin(admin.ModelAdmin):
list_display = ('id_localidad', 'nombre_localidad', 'cod_postal')
# class LocalidadAdmin(admin.ModelAdmin):
# list_display = ('id_localidad', 'nombre_localidad', 'cod_postal')

class BarrioAdmin(admin.ModelAdmin):
list_display = ('id_barrio', 'nombre_barrio')
# class BarrioAdmin(admin.ModelAdmin):
# list_display = ('id_barrio', 'nombre_barrio')

class RolAdmin(admin.ModelAdmin):
list_display = ('id_rol','nombre_rol')
Expand Down Expand Up @@ -75,13 +75,13 @@ def has_delete_permission(self, request, obj=None):
def has_add_permission(self, request, obj=None):
return False

class CompraAdmin(admin.ModelAdmin):
inlines = [DetalleInline]
# class CompraAdmin(admin.ModelAdmin):
# inlines = [DetalleInline]



admin.site.register(Localidad, LocalidadAdmin )
admin.site.register(Barrio, BarrioAdmin)
# admin.site.register(Localidad, LocalidadAdmin )
# admin.site.register(Barrio, BarrioAdmin)
admin.site.register(Direccion, DireccionAdmin)
admin.site.register(Producto, ProductoAdmin)
admin.site.register(Rol, RolAdmin)
Expand Down
74 changes: 22 additions & 52 deletions backend/ricco/ricco_app/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Generated by Django 4.2 on 2024-06-12 00:23
# Generated by Django 4.2 on 2025-05-03 15:28

from django.conf import settings
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
Expand All @@ -23,12 +22,12 @@ class Migration(migrations.Migration):
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('username', models.CharField(blank=True, max_length=150, null=True, unique=True)),
('email', models.EmailField(max_length=150, unique=True)),
('telefono', models.CharField(max_length=50, null=True)),
],
Expand All @@ -38,26 +37,14 @@ class Migration(migrations.Migration):
'db_table': 'usuario',
},
),
migrations.CreateModel(
name='Barrio',
fields=[
('id_barrio', models.AutoField(primary_key=True, serialize=False)),
('nombre_barrio', models.CharField(default='', max_length=50)),
],
options={
'verbose_name': 'Barrio',
'verbose_name_plural': 'Barrios',
'db_table': 'barrio',
},
),
migrations.CreateModel(
name='Compra',
fields=[
('id_compra', models.AutoField(primary_key=True, serialize=False)),
('fecha', models.DateField(auto_now_add=True)),
('descripcion', models.TextField(default='', max_length=1000)),
('precio_total', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
('user', models.ForeignKey(blank=True, default='', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='compra', to=settings.AUTH_USER_MODEL)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='compras', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Compra',
Expand All @@ -66,16 +53,16 @@ class Migration(migrations.Migration):
},
),
migrations.CreateModel(
name='Localidad',
name='Direccion',
fields=[
('id_localidad', models.AutoField(primary_key=True, serialize=False)),
('nombre_localidad', models.CharField(default='', max_length=50)),
('cod_postal', models.IntegerField(default=2000)),
('id_direccion', models.AutoField(primary_key=True, serialize=False)),
('calle', models.CharField(default='', max_length=100)),
('numero', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
],
options={
'verbose_name': 'Localidad',
'verbose_name_plural': 'Localidades',
'db_table': 'localidad',
'verbose_name': 'Direccion',
'verbose_name_plural': 'Direcciones',
'db_table': 'direccion',
},
),
migrations.CreateModel(
Expand All @@ -88,7 +75,7 @@ class Migration(migrations.Migration):
options={
'verbose_name': 'Permiso',
'verbose_name_plural': 'Permisos',
'db_table': 'Permiso',
'db_table': 'permiso',
},
),
migrations.CreateModel(
Expand All @@ -98,6 +85,8 @@ class Migration(migrations.Migration):
('nombre_producto', models.CharField(default='', max_length=100)),
('descripcion', models.TextField(default='', max_length=255)),
('precio', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
('visible', models.BooleanField(default=True)),
('main_imagen', models.ImageField(blank=True, null=True, upload_to='products/')),
],
options={
'verbose_name': 'Producto',
Expand All @@ -121,13 +110,13 @@ class Migration(migrations.Migration):
name='Rol_Permiso',
fields=[
('id_rol_permiso', models.AutoField(primary_key=True, serialize=False)),
('permiso', models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, related_name='rol_permiso', to='ricco_app.permiso')),
('rol', models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, related_name='rol_permiso', to='ricco_app.rol')),
('permiso', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rol_permiso', to='ricco_app.permiso')),
('rol', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rol_permiso', to='ricco_app.rol')),
],
options={
'verbose_name': 'Rol_Permiso',
'verbose_name_plural': 'Rol_Permisos',
'db_table': 'Rol_Permiso',
'db_table': 'rol_permiso',
},
),
migrations.CreateModel(
Expand All @@ -136,26 +125,12 @@ class Migration(migrations.Migration):
('id_pedido', models.AutoField(primary_key=True, serialize=False)),
('fecha_pedido', models.DateField(auto_now_add=True)),
('estado', models.CharField(default='', max_length=50)),
('user', models.ForeignKey(blank=True, default='', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pedido', to=settings.AUTH_USER_MODEL)),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pedido', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Pedido',
'verbose_name_plural': 'Pedidos',
'db_table': 'Pedido',
},
),
migrations.CreateModel(
name='Direccion',
fields=[
('id_direccion', models.AutoField(primary_key=True, serialize=False)),
('calle', models.CharField(default='', max_length=100)),
('numero', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
('barrio', models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, related_name='direccion', to='ricco_app.barrio')),
],
options={
'verbose_name': 'Direccion',
'verbose_name_plural': 'Direcciones',
'db_table': 'direccion',
'db_table': 'pedido',
},
),
migrations.CreateModel(
Expand All @@ -164,24 +139,19 @@ class Migration(migrations.Migration):
('id_detalle', models.AutoField(primary_key=True, serialize=False)),
('cantidad', models.IntegerField(default=1)),
('precio_calculado', models.DecimalField(decimal_places=2, default=0.0, max_digits=10)),
('compra', models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, related_name='detalle', to='ricco_app.compra')),
('producto', models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, related_name='detalle', to='ricco_app.producto')),
('compra', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='detalle', to='ricco_app.compra')),
('producto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='detalle', to='ricco_app.producto')),
],
options={
'verbose_name': 'Detalle',
'verbose_name_plural': 'Detalles',
'db_table': 'detalle',
},
),
migrations.AddField(
model_name='barrio',
name='localidad',
field=models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, related_name='barrio', to='ricco_app.localidad'),
),
migrations.AddField(
model_name='customuser',
name='direccion',
field=models.ForeignKey(blank=True, default='', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='usuario', to='ricco_app.direccion'),
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='usuario', to='ricco_app.direccion'),
),
migrations.AddField(
model_name='customuser',
Expand All @@ -191,7 +161,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='customuser',
name='rol',
field=models.ForeignKey(blank=True, default='', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='usuario', to='ricco_app.rol'),
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='usuario', to='ricco_app.rol'),
),
migrations.AddField(
model_name='customuser',
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions backend/ricco/ricco_app/migrations/0005_alter_compra_user.py

This file was deleted.

Loading