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-12 19:35:27 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
61b8a05a6a4d95d392291bb2e2c60425d2fca5a2
61b8a05a
1 parent
48ae319d
se agrego usuario_movimiento a el modelo edicto
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
0 deletions
project/apps/edicto/migrations/0014_edicto_usuario_movimiento.py
project/apps/edicto/migrations/0015_edicto_usuario_movi.py
project/apps/edicto/models.py
project/apps/edicto/migrations/0014_edicto_usuario_movimiento.py
0 → 100644
View file @
61b8a05
# Generated by Django 4.1.9 on 2023-09-12 21:23
from
django.conf
import
settings
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
migrations
.
swappable_dependency
(
settings
.
AUTH_USER_MODEL
),
(
'edicto'
,
'0013_alter_edicto_estado'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'edicto'
,
name
=
'usuario_movimiento'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'udate_edicto'
,
to
=
settings
.
AUTH_USER_MODEL
),
),
]
...
...
project/apps/edicto/migrations/0015_edicto_usuario_movi.py
0 → 100644
View file @
61b8a05
# Generated by Django 4.1.9 on 2023-09-12 21:24
from
django.conf
import
settings
from
django.db
import
migrations
,
models
import
django.db.models.deletion
def
migrar_edicto_usuario_movi
(
apps
,
schema
):
Edictos
=
apps
.
get_model
(
'edicto'
,
'Edicto'
)
user_move
=
1
for
edicto
in
Edictos
.
objects
.
all
():
edicto
.
usuario_movimiento
=
user_move
edicto
.
save
()
user_move
=
user_move
+
1
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'edicto'
,
'0014_edicto_usuario_movimiento'
),
]
operations
=
[
migrations
.
RunPython
(
migrar_edicto_usuario_movi
,
reverse_code
=
migrations
.
RunPython
.
noop
),
migrations
.
AlterField
(
model_name
=
'edicto'
,
name
=
'usuario_movimiento'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'udate_edicto'
,
to
=
settings
.
AUTH_USER_MODEL
)
),
]
...
...
project/apps/edicto/models.py
View file @
61b8a05
...
...
@@ -38,6 +38,7 @@ class Edicto(models.Model):
observaciones
=
models
.
CharField
(
max_length
=
500
,
blank
=
True
,
null
=
True
)
fecha_creacion
=
models
.
DateField
(
auto_now_add
=
True
)
fecha_modificacion
=
models
.
DateTimeField
(
auto_now_add
=
True
)
usuario_movimiento
=
models
.
ForeignKey
(
Usuario
,
on_delete
=
models
.
CASCADE
,
related_name
=
'udate_edicto'
)
class
Meta
:
verbose_name
=
'Edicto'
...
...
Please
register
or
login
to post a comment