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-25 09:21:51 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
284aac8b4290cbf769bcb151699e0c30ff26da9f
284aac8b
1 parent
6c7983fb
se agrega el valor id por defecto
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
0 deletions
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/serializer.py
project/apps/edicto/migrations/0002_remove_edicto_uuid_edicto_id.py
0 → 100644
View file @
284aac8
# 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 @
284aac8
# 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 @
284aac8
# 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/serializer.py
View file @
284aac8
...
...
@@ -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