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-27 09:56:21 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e7211fcf308ebe7030b24bb88fd70564574ff0be
e7211fcf
1 parent
86b0da73
se agregaron filtros y elementos a modelo
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
4 deletions
project/apps/edicto/filters.py
project/apps/edicto/migrations/0005_remove_comprobantepago_monto_and_more.py
project/apps/edicto/models.py
project/apps/edicto/filters.py
View file @
e7211fc
...
...
@@ -8,6 +8,7 @@ class EdictoFilter(filters.FilterSet):
class
Meta
:
model
=
Edicto
fields
=
{
'creado_por'
:
[
'exact'
],
'modificado_por'
:
[
'exact'
],
'estado'
:
[
'exact'
],
'uuid'
:
[
'exact'
],
}
...
...
project/apps/edicto/migrations/0005_remove_comprobantepago_monto_and_more.py
0 → 100644
View file @
e7211fc
# Generated by Django 4.1.9 on 2023-09-27 12:46
from
django.conf
import
settings
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
migrations
.
swappable_dependency
(
settings
.
AUTH_USER_MODEL
),
(
'edicto'
,
'0004_migracion_dato_uuid'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'comprobantepago'
,
name
=
'monto'
,
),
migrations
.
AddField
(
model_name
=
'comprobantepago'
,
name
=
'monto_descuento'
,
field
=
models
.
FloatField
(
editable
=
False
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'comprobantepago'
,
name
=
'monto_subtotal'
,
field
=
models
.
FloatField
(
editable
=
False
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'comprobantepago'
,
name
=
'monto_total'
,
field
=
models
.
FloatField
(
editable
=
False
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'precio'
,
name
=
'precio_dia'
,
field
=
models
.
FloatField
(
default
=
90.34
),
preserve_default
=
False
,
),
migrations
.
AlterField
(
model_name
=
'edicto'
,
name
=
'creado_por'
,
field
=
models
.
ForeignKey
(
editable
=
False
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
),
),
migrations
.
AlterField
(
model_name
=
'precio'
,
name
=
'usuario'
,
field
=
models
.
ForeignKey
(
editable
=
False
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
),
),
]
...
...
project/apps/edicto/models.py
View file @
e7211fc
...
...
@@ -13,10 +13,11 @@ class Precio(models.Model):
precio
=
models
.
FloatField
(
max_length
=
50
,
blank
=
False
,
null
=
False
)
vigencia_desde
=
models
.
DateField
()
vigencia_hasta
=
models
.
DateField
(
blank
=
True
,
null
=
True
)
usuario
=
models
.
ForeignKey
(
Usuario
,
on_delete
=
models
.
CASCADE
)
usuario
=
models
.
ForeignKey
(
Usuario
,
on_delete
=
models
.
CASCADE
,
editable
=
False
)
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
()
class
Meta
:
verbose_name
=
'Precio'
...
...
@@ -44,13 +45,13 @@ class Edicto(models.Model):
fecha_publicacion
=
models
.
DateField
(
blank
=
True
,
null
=
True
)
fecha_creacion
=
models
.
DateField
(
auto_now_add
=
True
,
editable
=
False
)
fecha_modificacion
=
models
.
DateTimeField
(
auto_now
=
True
,
editable
=
False
)
creado_por
=
models
.
ForeignKey
(
Usuario
,
on_delete
=
models
.
CASCADE
,
verbose_name
=
'Usuario'
,
editable
=
False
)
creado_por
=
models
.
ForeignKey
(
Usuario
,
on_delete
=
models
.
CASCADE
,
editable
=
False
)
modificado_por
=
models
.
ForeignKey
(
Usuario
,
on_delete
=
models
.
CASCADE
,
related_name
=
'update_edicto'
,
editable
=
False
)
def
__str__
(
self
):
return
self
.
creado_por
return
f
"{self.creado_por} - Edicto"
class
ComprobantePago
(
models
.
Model
):
...
...
@@ -58,7 +59,9 @@ class ComprobantePago(models.Model):
verbose_name
=
'ComprobantePago'
verbose_name_plural
=
'ComprobantesPagos'
monto
=
models
.
FloatField
()
monto_total
=
models
.
FloatField
(
editable
=
False
,
null
=
True
)
monto_subtotal
=
models
.
FloatField
(
editable
=
False
,
null
=
True
)
monto_descuento
=
models
.
FloatField
(
editable
=
False
,
null
=
True
)
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
)
...
...
Please
register
or
login
to post a comment