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 11:17:55 -0300
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
cb8f80715cb1c71cebbc4975da2384e0d69e2dee
cb8f8071
2 parents
86b0da73
3b555035
Merge branch 'migracion/edicto' into 'develop'
Migracion/edicto See merge request
!60
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
192 deletions
project/apps/edicto/filters.py
project/apps/edicto/migrations/0001_initial.py
project/apps/edicto/migrations/0002_remove_edicto_uuid_edicto_id.py
project/apps/edicto/migrations/0003_edicto_uuid.py
project/apps/edicto/migrations/0004_migracion_dato_uuid.py
project/apps/edicto/models.py
project/apps/edicto/filters.py
View file @
cb8f807
...
...
@@ -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/0001_initial.py
View file @
cb8f807
# Generated by Django 4.1.9 on 2023-09-2
1 13:18
# Generated by Django 4.1.9 on 2023-09-2
7 14:12
from
django.conf
import
settings
from
django.db
import
migrations
,
models
...
...
@@ -7,6 +7,7 @@ import uuid
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
...
...
@@ -15,141 +16,58 @@ class Migration(migrations.Migration):
operations
=
[
migrations
.
CreateModel
(
name
=
"Precio"
,
name
=
'Precio'
,
fields
=
[
(
"id"
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
"ID"
,
),
),
(
"precio"
,
models
.
FloatField
(
max_length
=
50
)),
(
"vigencia_desde"
,
models
.
DateField
()),
(
"vigencia_hasta"
,
models
.
DateField
(
blank
=
True
,
null
=
True
)),
(
"moneda"
,
models
.
CharField
(
choices
=
[
(
"peso_argentino"
,
"peso_argentino"
),
(
"dolar"
,
"dolar"
),
(
"euro"
,
"euro"
),
],
default
=
"peso_argentino"
,
max_length
=
50
,
),
),
(
"precio_ejemplar"
,
models
.
FloatField
(
max_length
=
50
)),
(
"usuario"
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
,
),
),
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'precio'
,
models
.
FloatField
(
max_length
=
50
)),
(
'vigencia_desde'
,
models
.
DateField
()),
(
'vigencia_hasta'
,
models
.
DateField
(
blank
=
True
,
null
=
True
)),
(
'moneda'
,
models
.
CharField
(
choices
=
[(
'peso_argentino'
,
'peso_argentino'
),
(
'dolar'
,
'dolar'
),
(
'euro'
,
'euro'
)],
default
=
'peso_argentino'
,
max_length
=
50
)),
(
'precio_ejemplar'
,
models
.
FloatField
(
max_length
=
50
)),
(
'usuario'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
options
=
{
"verbose_name"
:
"Precio"
,
"verbose_name_plural"
:
"Precios"
,
'verbose_name'
:
'Precio'
,
'verbose_name_plural'
:
'Precios'
,
},
),
migrations
.
CreateModel
(
name
=
"Edicto"
,
name
=
'Edicto'
,
fields
=
[
(
"uuid"
,
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
editable
=
False
,
primary_key
=
True
,
serialize
=
False
,
unique
=
True
,
),
),
(
"cuerpo_edicto"
,
models
.
TextField
()),
(
"archivo"
,
models
.
FileField
(
upload_to
=
"uploads/
%
Y/
%
m/
%
d/"
)),
(
"dias_publicar"
,
models
.
PositiveIntegerField
()),
(
"cantidad_sellos"
,
models
.
PositiveIntegerField
()),
(
"estado"
,
models
.
CharField
(
choices
=
[
(
"iniciado"
,
"iniciado"
),
(
"pendiente_revision"
,
"pendiente_revision"
),
(
"pendiente_de_pago"
,
"pendiente_de_pago"
),
(
"pendiente_pago_revision"
,
"pendiente_pago_revision"
),
(
"publicado"
,
"publicado"
),
(
"aprobado"
,
"aprobado"
),
(
"rechazado"
,
"rechazado"
),
],
default
=
"inciado"
,
max_length
=
23
,
),
),
(
"cantidad_palabras"
,
models
.
IntegerField
(
editable
=
False
)),
(
"cantidad_copias"
,
models
.
PositiveIntegerField
()),
(
"observaciones"
,
models
.
CharField
(
blank
=
True
,
max_length
=
500
)),
(
"fecha_publicacion"
,
models
.
DateField
(
blank
=
True
,
null
=
True
)),
(
"fecha_creacion"
,
models
.
DateField
(
auto_now_add
=
True
)),
(
"fecha_modificacion"
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
"creado_por"
,
models
.
ForeignKey
(
editable
=
False
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
,
verbose_name
=
"Usuario"
,
),
),
(
"modificado_por"
,
models
.
ForeignKey
(
editable
=
False
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
"update_edicto"
,
to
=
settings
.
AUTH_USER_MODEL
,
),
),
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'uuid'
,
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
editable
=
False
,
unique
=
True
)),
(
'cuerpo_edicto'
,
models
.
TextField
()),
(
'archivo'
,
models
.
FileField
(
upload_to
=
'uploads/
%
Y/
%
m/
%
d/'
)),
(
'dias_publicar'
,
models
.
PositiveIntegerField
()),
(
'cantidad_sellos'
,
models
.
PositiveIntegerField
()),
(
'estado'
,
models
.
CharField
(
choices
=
[(
'iniciado'
,
'iniciado'
),
(
'pendiente_revision'
,
'pendiente_revision'
),
(
'pendiente_de_pago'
,
'pendiente_de_pago'
),
(
'pendiente_pago_revision'
,
'pendiente_pago_revision'
),
(
'publicado'
,
'publicado'
),
(
'aprobado'
,
'aprobado'
),
(
'rechazado'
,
'rechazado'
)],
default
=
'inciado'
,
max_length
=
23
)),
(
'cantidad_palabras'
,
models
.
IntegerField
(
editable
=
False
)),
(
'cantidad_copias'
,
models
.
PositiveIntegerField
()),
(
'observaciones'
,
models
.
CharField
(
blank
=
True
,
max_length
=
500
)),
(
'fecha_publicacion'
,
models
.
DateField
(
blank
=
True
,
null
=
True
)),
(
'fecha_creacion'
,
models
.
DateField
(
auto_now_add
=
True
)),
(
'fecha_modificacion'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'creado_por'
,
models
.
ForeignKey
(
editable
=
False
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
)),
(
'modificado_por'
,
models
.
ForeignKey
(
editable
=
False
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'update_edicto'
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
options
=
{
"verbose_name"
:
"Edicto"
,
"verbose_name_plural"
:
"Edictos"
,
'verbose_name'
:
'Edicto'
,
'verbose_name_plural'
:
'Edictos'
,
},
),
migrations
.
CreateModel
(
name
=
"ComprobantePago"
,
name
=
'ComprobantePago'
,
fields
=
[
(
"id"
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
"ID"
,
),
),
(
"monto"
,
models
.
FloatField
()),
(
"numero_comprobante"
,
models
.
CharField
(
blank
=
True
,
max_length
=
300
,
null
=
True
),
),
(
"fecha_pago"
,
models
.
DateTimeField
(
blank
=
True
,
null
=
True
)),
(
"archivo"
,
models
.
FileField
(
blank
=
True
,
upload_to
=
"uploads/
%
Y/
%
m/
%
d/"
),
),
(
"edicto"
,
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
"edicto.edicto"
),
),
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'monto'
,
models
.
FloatField
()),
(
'numero_comprobante'
,
models
.
CharField
(
blank
=
True
,
max_length
=
300
,
null
=
True
)),
(
'fecha_pago'
,
models
.
DateTimeField
(
blank
=
True
,
null
=
True
)),
(
'archivo'
,
models
.
FileField
(
blank
=
True
,
upload_to
=
'uploads/
%
Y/
%
m/
%
d/'
)),
(
'edicto'
,
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'edicto.edicto'
)),
],
options
=
{
"verbose_name"
:
"ComprobantePago"
,
"verbose_name_plural"
:
"ComprobantesPagos"
,
'verbose_name'
:
'ComprobantePago'
,
'verbose_name_plural'
:
'ComprobantesPagos'
,
},
),
]
...
...
project/apps/edicto/migrations/0002_remove_edicto_uuid_edicto_id.py
deleted
100644 → 0
View file @
86b0da7
# Generated by Django 4.1.9 on 2023-09-25 11:23
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'edicto'
,
'0001_initial'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'edicto'
,
name
=
'uuid'
,
),
migrations
.
AddField
(
model_name
=
'edicto'
,
name
=
'id'
,
field
=
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
),
preserve_default
=
False
,
),
]
project/apps/edicto/migrations/0003_edicto_uuid.py
deleted
100644 → 0
View file @
86b0da7
# Generated by Django 4.1.9 on 2023-09-25 11:29
from
django.db
import
migrations
,
models
import
uuid
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'edicto'
,
'0002_remove_edicto_uuid_edicto_id'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'edicto'
,
name
=
'uuid'
,
field
=
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
editable
=
False
,
null
=
True
,
unique
=
True
),
),
]
project/apps/edicto/migrations/0004_migracion_dato_uuid.py
deleted
100644 → 0
View file @
86b0da7
# Generated by Django 4.1.9 on 2023-09-25 11:35
from
django.db
import
migrations
,
models
import
uuid
def
migrar_datos_uuid
(
apps
,
schema
):
Edictos
=
apps
.
get_model
(
'edicto'
,
'Edicto'
)
for
edicto
in
Edictos
.
objects
.
all
():
edicto
.
uuid
=
uuid
.
uuid4
()
edicto
.
save
()
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'edicto'
,
'0003_edicto_uuid'
),
]
operations
=
[
migrations
.
RunPython
(
migrar_datos_uuid
,
reverse_code
=
migrations
.
RunPython
.
noop
),
migrations
.
AlterField
(
model_name
=
'edicto'
,
name
=
'uuid'
,
field
=
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
editable
=
False
,
unique
=
True
),
),
]
project/apps/edicto/models.py
View file @
cb8f807
...
...
@@ -44,13 +44,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
):
...
...
Please
register
or
login
to post a comment