Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Enzo Yair
/
turismo-api
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Enzo Yair
2024-10-01 21:55:13 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
90c6f59a35873a026f637e5fd1146fd1f530c472
90c6f59a
1 parent
e2cae1c8
fin de evento_admin
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
project/apps/evento/forms.py
project/apps/evento/migrations/0001_initial.py
project/apps/evento/models.py
project/apps/evento/forms.py
View file @
90c6f59
...
...
@@ -62,8 +62,8 @@ class EventoForms(forms.ModelForm):
fecha_final
=
clean
.
get
(
'fecha_final'
)
hora_fin
=
clean
.
get
(
'hora_fin'
)
if
fecha_inicio
and
fecha_final
and
fecha_final
==
fecha_inicio
:
if
hora_inicio
and
hora_fin
and
hora_fin
<=
hora_inicio
:
if
fecha_final
==
fecha_inicio
:
if
hora_fin
<=
hora_inicio
:
raise
ValidationError
(
_
(
'La hora de finalización debe ser posterior a la hora de inicio.'
)
...
...
project/apps/evento/migrations/0001_initial.py
View file @
90c6f59
# Generated by Django 4.2.9 on 2024-10-0
1 21:42
# Generated by Django 4.2.9 on 2024-10-0
2 00:54
import
django.core.validators
from
django.db
import
migrations
,
models
...
...
@@ -33,13 +33,13 @@ class Migration(migrations.Migration):
(
'fecha_final'
,
models
.
DateField
(
verbose_name
=
'Fecha de cierre del evento'
)),
(
'hora_fin'
,
models
.
TimeField
(
verbose_name
=
'Hora de cierre'
)),
(
'titulo'
,
models
.
CharField
(
max_length
=
350
)),
(
'categoria'
,
models
.
Slug
Field
(
max_length
=
150
)),
(
'categoria'
,
models
.
Char
Field
(
max_length
=
150
)),
(
'direccion'
,
models
.
URLField
(
help_text
=
'Ingrese la url obtenida por google maps'
,
max_length
=
150
,
verbose_name
=
'Ubicación del evento'
)),
(
'descripcion'
,
models
.
TextField
(
verbose_name
=
'Descripción'
)),
(
'url'
,
models
.
URLField
(
blank
=
True
,
max_length
=
300
,
verbose_name
=
'Dirección Web'
)),
(
'imagen'
,
models
.
ImageField
(
blank
=
True
,
upload_to
=
'static/eventos'
,
validators
=
[
django
.
core
.
validators
.
FileExtensionValidator
(
allowed_extensions
=
[
'jpg'
,
'png'
])],
verbose_name
=
'Banner promocional'
)),
(
'dependencia'
,
models
.
ManyToManyField
(
blank
=
True
,
related_name
=
'evento_dependencia'
,
to
=
'organismo.dependencia'
)),
(
'fechas'
,
models
.
ManyToManyField
(
blank
=
True
,
related_name
=
'evento_fechas'
,
to
=
'evento.fechaevento'
,
verbose_name
=
'Días disponibles'
)),
(
'fechas'
,
models
.
ManyToManyField
(
blank
=
True
,
help_text
=
'Por favor, indique los días disponibles para el evento'
,
related_name
=
'evento_fechas'
,
to
=
'evento.fechaevento'
,
verbose_name
=
'Días disponibles'
)),
(
'organismo'
,
models
.
ManyToManyField
(
blank
=
True
,
related_name
=
'evento_organismo'
,
to
=
'organismo.organismo'
)),
],
options
=
{
...
...
project/apps/evento/models.py
View file @
90c6f59
...
...
@@ -32,9 +32,10 @@ class Evento(models.Model):
related_name
=
'evento_fechas'
,
blank
=
True
,
verbose_name
=
'Días disponibles'
,
help_text
=
'Por favor, indique los días disponibles para el evento'
)
titulo
=
models
.
CharField
(
max_length
=
350
,
null
=
False
)
categoria
=
models
.
Slug
Field
(
max_length
=
150
,
null
=
False
)
categoria
=
models
.
Char
Field
(
max_length
=
150
,
null
=
False
)
direccion
=
models
.
URLField
(
max_length
=
150
,
verbose_name
=
'Ubicación del evento'
,
...
...
Please
register
or
login
to post a comment