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-20 09:56:54 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3026bffcfa535799c0555be0ecc78f092c5caea4
3026bffc
1 parent
02fa6d48
migraciones finales
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
8 deletions
project/apps/edicto/migrations/0019_comprobantepago_archivo_alter_comprobantepago_edicto_and_more.py
project/apps/edicto/models.py
project/apps/edicto/serializer.py
project/apps/edicto/migrations/0019_comprobantepago_archivo_alter_comprobantepago_edicto_and_more.py
0 → 100644
View file @
3026bff
# Generated by Django 4.1.9 on 2023-09-20 12:55
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'edicto'
,
'0018_alter_edicto_fecha_modificacion'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'comprobantepago'
,
name
=
'archivo'
,
field
=
models
.
FileField
(
blank
=
True
,
upload_to
=
'uploads/
%
Y/
%
m/
%
d/'
),
),
migrations
.
AlterField
(
model_name
=
'comprobantepago'
,
name
=
'edicto'
,
field
=
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'edicto.edicto'
),
),
migrations
.
AlterField
(
model_name
=
'comprobantepago'
,
name
=
'fecha_pago'
,
field
=
models
.
DateTimeField
(
blank
=
True
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'comprobantepago'
,
name
=
'monto'
,
field
=
models
.
FloatField
(
editable
=
False
),
),
migrations
.
AlterField
(
model_name
=
'comprobantepago'
,
name
=
'numero_comprobante'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
300
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'edicto'
,
name
=
'cantidad_palabras'
,
field
=
models
.
IntegerField
(
editable
=
False
),
),
migrations
.
AlterField
(
model_name
=
'precio'
,
name
=
'vigencia_hasta'
,
field
=
models
.
DateField
(
blank
=
True
,
null
=
True
),
),
]
...
...
project/apps/edicto/models.py
View file @
3026bff
...
...
@@ -11,7 +11,7 @@ from usuario.models import Usuario
class
Precio
(
models
.
Model
):
precio
=
models
.
FloatField
(
max_length
=
50
,
blank
=
False
,
null
=
False
)
vigencia_desde
=
models
.
DateField
()
vigencia_hasta
=
models
.
DateField
()
vigencia_hasta
=
models
.
DateField
(
blank
=
True
,
null
=
True
)
usuario
=
models
.
ForeignKey
(
Usuario
,
on_delete
=
models
.
CASCADE
)
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
)
...
...
@@ -32,7 +32,7 @@ class Edicto(models.Model):
dias_publicar
=
models
.
PositiveIntegerField
(
blank
=
False
,
null
=
False
)
cantidad_sellos
=
models
.
PositiveIntegerField
(
blank
=
False
,
null
=
False
)
estado
=
models
.
CharField
(
max_length
=
150
,
choices
=
STATUS_CHOICE
,
default
=
'inciado'
)
cantidad_palabras
=
models
.
IntegerField
(
blank
=
False
,
null
=
False
)
cantidad_palabras
=
models
.
IntegerField
(
blank
=
False
,
null
=
False
,
editable
=
False
)
cantidad_copias
=
models
.
PositiveIntegerField
(
blank
=
False
,
null
=
False
)
fecha_publicacion
=
models
.
DateField
(
blank
=
True
,
null
=
True
)
observaciones
=
models
.
CharField
(
max_length
=
500
,
blank
=
True
,
null
=
True
)
...
...
@@ -45,14 +45,15 @@ class Edicto(models.Model):
verbose_name_plural
=
'Edictos'
def
__str__
(
self
):
return
self
.
cuerpo_edict
o
return
self
.
usuari
o
class
ComprobantePago
(
models
.
Model
):
monto
=
models
.
FloatField
(
blank
=
False
,
null
=
False
)
numero_comprobante
=
models
.
CharField
(
max_length
=
300
,
blank
=
False
,
null
=
True
)
fecha_pago
=
models
.
DateTimeField
(
blank
=
False
,
null
=
True
)
edicto
=
models
.
ForeignKey
(
Edicto
,
on_delete
=
models
.
CASCADE
)
monto
=
models
.
FloatField
(
blank
=
False
,
null
=
False
,
editable
=
False
)
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
)
archivo
=
models
.
FileField
(
upload_to
=
"uploads/
%
Y/
%
m/
%
d/"
,
blank
=
True
,
null
=
False
)
class
Meta
:
verbose_name
=
'ComprobantePago'
...
...
project/apps/edicto/serializer.py
View file @
3026bff
...
...
@@ -32,7 +32,7 @@ class EdictoSerializer(serializers.ModelSerializer):
)
read_only_fields
=
(
'fecha_publicacion'
,
'cantidad_palabras'
,
read_only_fields
=
(
'fecha_publicacion'
,
)
def
validate
(
self
,
data
):
...
...
Please
register
or
login
to post a comment