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
Martín Miranda
2023-09-26 08:42:11 -0300
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
38bde49bf3a1e2b692cb38b81311b405800801db
38bde49b
2 parents
be314603
284aac8b
Merge branch 'fix/modelo_edicto' into 'develop'
Fix/modelo edicto See merge request
!53
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
2 deletions
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/serializer.py
project/apps/edicto/migrations/0001_initial.py
View file @
38bde49
...
...
@@ -63,7 +63,6 @@ class Migration(migrations.Migration):
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
editable
=
False
,
primary_key
=
True
,
serialize
=
False
,
unique
=
True
,
),
...
...
project/apps/edicto/migrations/0002_remove_edicto_uuid_edicto_id.py
0 → 100644
View file @
38bde49
# 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
0 → 100644
View file @
38bde49
# 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
0 → 100644
View file @
38bde49
# 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 @
38bde49
...
...
@@ -31,7 +31,7 @@ class Edicto(models.Model):
verbose_name
=
'Edicto'
verbose_name_plural
=
'Edictos'
uuid
=
models
.
UUIDField
(
unique
=
True
,
editable
=
False
,
default
=
uuid4
,
primary_key
=
True
)
uuid
=
models
.
UUIDField
(
unique
=
True
,
editable
=
False
,
default
=
uuid4
)
cuerpo_edicto
=
models
.
TextField
(
blank
=
False
)
archivo
=
models
.
FileField
(
upload_to
=
"uploads/
%
Y/
%
m/
%
d/"
)
dias_publicar
=
models
.
PositiveIntegerField
()
...
...
project/apps/edicto/serializer.py
View file @
38bde49
...
...
@@ -15,6 +15,7 @@ class EdictoSerializer(serializers.ModelSerializer):
class
Meta
:
model
=
Edicto
fields
=
(
'uuid'
,
'creado_por'
,
'modificado_por'
,
'estado'
,
...
...
Please
register
or
login
to post a comment