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
Marta Miranda
2023-08-14 08:55:22 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
65afefd9cd66b7b62ffb7823ae0ca0a43ede2283
65afefd9
1 parent
218586b4
Modificar migraciones
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletions
project/apps/usuario/migrations/0002_remove_usuario_documento_identidad_usuario_cuil.py
project/apps/usuario/migrations/0003_alter_usuario_cuil.py
project/apps/usuario/migrations/0002_remove_usuario_documento_identidad_usuario_cuil.py
View file @
65afefd
...
...
@@ -17,7 +17,7 @@ class Migration(migrations.Migration):
migrations
.
AddField
(
model_name
=
'usuario'
,
name
=
'cuil'
,
field
=
models
.
CharField
(
default
=
27242621528
,
max_length
=
11
,
unique
=
True
,
verbose_name
=
'Número de Cuil (Sin guiones)'
),
field
=
models
.
CharField
(
max_length
=
11
,
blank
=
True
,
verbose_name
=
'Número de Cuil (Sin guiones)'
),
preserve_default
=
False
,
),
]
...
...
project/apps/usuario/migrations/0003_alter_usuario_cuil.py
0 → 100644
View file @
65afefd
# Generated by Django 4.1.9 on 2023-08-14 11:41
from
django.db
import
migrations
,
models
def
asignar_valor_cuil
(
apps
,
schema
):
Usuario
=
apps
.
get_model
(
'usuario'
,
'Usuario'
)
nro_cuil
=
1
for
usuario
in
Usuario
.
objects
.
all
():
usuario
.
cuil
=
nro_cuil
usuario
.
save
()
nro_cuil
=
nro_cuil
+
1
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'usuario'
,
'0002_remove_usuario_documento_identidad_usuario_cuil'
),
]
operations
=
[
migrations
.
RunPython
(
asignar_valor_cuil
,
reverse_code
=
migrations
.
RunPython
.
noop
),
migrations
.
AlterField
(
model_name
=
'usuario'
,
name
=
'cuil'
,
field
=
models
.
CharField
(
max_length
=
11
,
unique
=
True
,
verbose_name
=
'Número de Cuil (Sin guiones)'
),
),
]
...
...
Please
register
or
login
to post a comment