Skip to content

Commit

Permalink
Merge branch 'main' into refactor/Cliente-validar-name
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmasemper authored Jun 5, 2024
2 parents 9dfd492 + b3a4c25 commit 9639d3f
Show file tree
Hide file tree
Showing 19 changed files with 872 additions and 196 deletions.
2 changes: 1 addition & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ target-version = "py38"

[lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
select = ["E4", "E7", "E9", "F", "D102"]
select = ["E4", "E7", "E9", "F", "COM812", "D102", "D103","I001"]
ignore = []

# Allow fix for all enabled rules (when `--fix`) is provided.
Expand Down
22 changes: 20 additions & 2 deletions app/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.urls import reverse

# Lista de enlaces de navegación con etiquetas, hrefs e íconos
links = [
{"label": "Inicio", "href": reverse("home"), "icon": "bi bi-house-door"},
{"label": "Clientes", "href": reverse("clients_repo"), "icon": "bi bi-people"},
Expand All @@ -10,9 +11,26 @@
{"label": "Veterinarios", "href": reverse("veterinary_repo"), "icon": "bi bi-people"},
]


def navbar(request):
"""
Genera el contexto del navegador con enlaces activos basados en la URL actual.
Args:
request (HttpRequest): La solicitud HTTP actual.
Returns:
dict: Un diccionario con los enlaces de navegación, marcando el enlace activo.
"""
def add_active(link):
"""
Añade la clave 'active' a un enlace si la URL coincide con la ruta actual.
Args:
link (dict): Un diccionario que representa un enlace de navegación.
Returns:
dict: Una copia del enlace con la clave 'active' añadida.
"""
copy = link.copy()

if copy["href"] == "/":
Expand All @@ -22,4 +40,4 @@ def add_active(link):

return copy

return {"links": map(add_active, links)}
return {"links": map(add_active, links)}
14 changes: 14 additions & 0 deletions app/migrations/0015_merge_20240603_1125.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 5.0.4 on 2024-06-03 14:25

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('app', '0012_alter_product_price'),
('app', '0014_merge_20240603_0914'),
]

operations = [
]
14 changes: 14 additions & 0 deletions app/migrations/0015_merge_20240603_1806.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 5.0.4 on 2024-06-03 21:06

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('app', '0012_alter_product_price'),
('app', '0014_merge_20240603_0914'),
]

operations = [
]
16 changes: 16 additions & 0 deletions app/migrations/0016_delete_veterinario.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 5.0.4 on 2024-06-03 23:34

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('app', '0015_merge_20240603_1806'),
]

operations = [
migrations.DeleteModel(
name='Veterinario',
),
]
14 changes: 14 additions & 0 deletions app/migrations/0017_merge_20240604_2359.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 5.0.4 on 2024-06-05 02:59

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('app', '0015_merge_20240603_1125'),
('app', '0016_delete_veterinario'),
]

operations = [
]
14 changes: 14 additions & 0 deletions app/migrations/0017_merge_20240605_0217.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 5.0.4 on 2024-06-05 05:17

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('app', '0015_merge_20240603_1125'),
('app', '0016_delete_veterinario'),
]

operations = [
]
23 changes: 23 additions & 0 deletions app/migrations/0018_remove_client_address_client_city.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.0.4 on 2024-06-05 05:18

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('app', '0017_merge_20240605_0217'),
]

operations = [
migrations.RemoveField(
model_name='client',
name='address',
),
migrations.AddField(
model_name='client',
name='city',
field=models.CharField(choices=[('La Plata', 'La Plata'), ('Berisso', 'Berisso'), ('Ensenada', 'Ensenada')], default=1, max_length=35),
preserve_default=False,
),
]
14 changes: 14 additions & 0 deletions app/migrations/0019_merge_20240605_0942.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 5.0.4 on 2024-06-05 12:42

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('app', '0017_merge_20240604_2359'),
('app', '0018_remove_client_address_client_city'),
]

operations = [
]
Loading

0 comments on commit 9639d3f

Please sign in to comment.