Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Marta Miranda
/
boletin_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
2023-07-13 08:55:27 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4c08902d2471d98fcfdcd3c6e7411fab343a2f03
4c08902d
1 parent
4dbae539
cambios_en_serializer_y_models
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
1 deletions
project/apps/edicto/constants.py
project/apps/edicto/migrations/0003_edicto_fecha_creacion_edicto_fecha_modificacion_and_more.py
project/apps/edicto/models.py
project/apps/edicto/serializer.py
project/apps/edicto/constants.py
View file @
4c08902
...
...
@@ -3,6 +3,7 @@ from django.utils.translation import gettext_lazy as _
INICIADO
=
'iniciado'
PENDIENTE_DE_PAGO
=
'pendiente_de_pago'
PUBLICADO
=
'publicado'
APROBADO
=
'aprobado'
RECHAZADO
=
'rechazado'
...
...
@@ -10,5 +11,6 @@ STATUS_CHOICE = [
(
INICIADO
,
_
(
'iniciado'
)),
(
PENDIENTE_DE_PAGO
,
_
(
'pendiente_de_pago'
)),
(
PUBLICADO
,
_
(
'publicado'
)),
(
APROBADO
,
_
(
'aprobado'
)),
(
RECHAZADO
,
_
(
'rechazado'
)),
]
...
...
project/apps/edicto/migrations/0003_edicto_fecha_creacion_edicto_fecha_modificacion_and_more.py
0 → 100644
View file @
4c08902
# Generated by Django 4.1.9 on 2023-07-13 11:49
from
django.db
import
migrations
,
models
import
django.utils.timezone
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'edicto'
,
'0002_alter_comprobantepago_fecha_pago_and_more'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'edicto'
,
name
=
'fecha_creacion'
,
field
=
models
.
DateTimeField
(
auto_now_add
=
True
,
default
=
django
.
utils
.
timezone
.
now
),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'edicto'
,
name
=
'fecha_modificacion'
,
field
=
models
.
DateTimeField
(
auto_now_add
=
True
,
default
=
django
.
utils
.
timezone
.
now
),
preserve_default
=
False
,
),
migrations
.
AlterField
(
model_name
=
'edicto'
,
name
=
'estado'
,
field
=
models
.
CharField
(
choices
=
[(
'iniciado'
,
'iniciado'
),
(
'pendiente_de_pago'
,
'pendiente_de_pago'
),
(
'publicado'
,
'publicado'
),
(
'aprobado'
,
'aprobado'
),
(
'rechazado'
,
'rechazado'
)],
default
=
'inciado'
,
max_length
=
150
),
),
]
...
...
project/apps/edicto/models.py
View file @
4c08902
...
...
@@ -37,6 +37,8 @@ class Edicto(models.Model):
cantidad_palabras
=
models
.
IntegerField
()
cantidad_copias
=
models
.
IntegerField
()
fecha_publicacion
=
models
.
DateTimeField
()
fecha_creacion
=
models
.
DateTimeField
(
auto_now_add
=
True
)
fecha_modificacion
=
models
.
DateTimeField
(
auto_now_add
=
True
)
class
Meta
:
verbose_name
=
'Edicto'
...
...
project/apps/edicto/serializer.py
View file @
4c08902
...
...
@@ -10,4 +10,9 @@ class EdictoSerializer(serializers.ModelSerializer):
class
Meta
:
model
=
Edicto
exclude
=
(
'updated'
,)
fields
=
(
'cuerpo_edicto'
,
'dias_publicar'
,
'cantidad_sellos'
,
'estado'
,
'cantidad_copias'
,
'fecha_publicacion'
,)
...
...
Please
register
or
login
to post a comment