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-09-28 10:20:43 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2b971bb619dc094069f46c3eabb1d94df96293c1
2b971bb6
1 parent
cb8f8071
feature/#68_agregar_campos_edicto
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
3 deletions
project/apps/edicto/api.py
project/apps/edicto/constants.py
project/apps/edicto/migrations/0002_rename_monto_comprobantepago_monto_descuento_and_more.py
project/apps/edicto/models.py
project/settings/base.py
project/apps/edicto/api.py
View file @
2b971bb
...
...
@@ -15,7 +15,7 @@ class EdictoViewSet(mixins.CreateModelMixin,
viewsets
.
GenericViewSet
):
serializer_class
=
EdictoSerializer
permission_classes
=
[
IsAuthenticated
]
permission_classes
=
[
IsAuthenticated
,
]
filter_backends
=
(
DjangoFilterBackend
,
filters
.
OrderingFilter
)
filterset_class
=
EdictoFilter
queryset
=
Edicto
.
objects
.
all
()
...
...
project/apps/edicto/constants.py
View file @
2b971bb
...
...
@@ -10,7 +10,6 @@ RECHAZADO = 'rechazado'
STATUS_CHOICE
=
[
(
INICIADO
,
_
(
'iniciado'
)),
(
PENDIENTE_REVISION
,
_
(
'pendiente_revision'
)),
(
PENDIENTE_DE_PAGO
,
_
(
'pendiente_de_pago'
)),
(
PENDIENTE_PAGO_REVISION
,
_
(
'pendiente_pago_revision'
)),
(
PUBLICADO
,
_
(
'publicado'
)),
...
...
project/apps/edicto/migrations/0002_rename_monto_comprobantepago_monto_descuento_and_more.py
0 → 100644
View file @
2b971bb
# Generated by Django 4.1.9 on 2023-09-28 13:17
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'edicto'
,
'0001_initial'
),
]
operations
=
[
migrations
.
RenameField
(
model_name
=
'comprobantepago'
,
old_name
=
'monto'
,
new_name
=
'monto_descuento'
,
),
migrations
.
AddField
(
model_name
=
'comprobantepago'
,
name
=
'monto_subtotal'
,
field
=
models
.
FloatField
(),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'comprobantepago'
,
name
=
'monto_total'
,
field
=
models
.
FloatField
(),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'edicto'
,
name
=
'tiene_descuento'
,
field
=
models
.
BooleanField
(
default
=
False
,
editable
=
False
),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'precio'
,
name
=
'precio_dia'
,
field
=
models
.
FloatField
(
max_length
=
50
),
preserve_default
=
False
,
),
migrations
.
AlterField
(
model_name
=
'edicto'
,
name
=
'estado'
,
field
=
models
.
CharField
(
choices
=
[(
'iniciado'
,
'iniciado'
),
(
'pendiente_de_pago'
,
'pendiente_de_pago'
),
(
'pendiente_pago_revision'
,
'pendiente_pago_revision'
),
(
'publicado'
,
'publicado'
),
(
'aprobado'
,
'aprobado'
),
(
'rechazado'
,
'rechazado'
)],
default
=
'inciado'
,
max_length
=
23
),
),
]
...
...
project/apps/edicto/models.py
View file @
2b971bb
...
...
@@ -17,6 +17,7 @@ class Precio(models.Model):
moneda
=
models
.
CharField
(
max_length
=
50
,
blank
=
False
,
null
=
False
,
choices
=
MONEDA
,
default
=
'peso_argentino'
)
precio_ejemplar
=
models
.
FloatField
(
max_length
=
50
,
blank
=
False
,
null
=
False
)
precio_dia
=
models
.
FloatField
(
max_length
=
50
,
blank
=
False
,
null
=
False
)
class
Meta
:
verbose_name
=
'Precio'
...
...
@@ -48,6 +49,7 @@ class Edicto(models.Model):
modificado_por
=
models
.
ForeignKey
(
Usuario
,
on_delete
=
models
.
CASCADE
,
related_name
=
'update_edicto'
,
editable
=
False
)
tiene_descuento
=
models
.
BooleanField
(
editable
=
False
)
def
__str__
(
self
):
return
f
"{self.creado_por} - Edicto"
...
...
@@ -58,7 +60,9 @@ class ComprobantePago(models.Model):
verbose_name
=
'ComprobantePago'
verbose_name_plural
=
'ComprobantesPagos'
monto
=
models
.
FloatField
()
monto_subtotal
=
models
.
FloatField
()
monto_total
=
models
.
FloatField
()
monto_descuento
=
models
.
FloatField
()
numero_comprobante
=
models
.
CharField
(
max_length
=
300
,
blank
=
True
,
null
=
True
)
fecha_pago
=
models
.
DateTimeField
(
blank
=
True
,
null
=
True
)
edicto
=
models
.
OneToOneField
(
Edicto
,
on_delete
=
models
.
CASCADE
)
...
...
project/settings/base.py
View file @
2b971bb
...
...
@@ -192,3 +192,4 @@ AUTHENTICATION_BACKENDS = (
# Secret Key para Captcha.
SECRET_KEY_CAPTCHA
=
env
.
str
(
'SECRET_KEY_CAPTCHA'
,
default
=
""
)
SECRET_KEY_CAPTCHA_FRONT
=
env
.
str
(
'SECRET_KEY_CAPTCHA_FRONT'
,
default
=
""
)
...
...
Please
register
or
login
to post a comment