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-09-12 10:20:57 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4b2fed9131780322ece5b85835be956bc5d0e99e
4b2fed91
1 parent
ddb06b29
Closed feature/#56_agregar_es_usuario_boletin_a_usuario
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
2 deletions
project/apps/usuario/admin.py
project/apps/usuario/migrations/0004_usuario_es_usuario_boletin.py
project/apps/usuario/models.py
project/apps/usuario/serializers.py
project/apps/usuario/admin.py
View file @
4b2fed9
...
...
@@ -15,7 +15,8 @@ class UsuarioAdmin(UserAdmin):
'first_name'
,
'last_name'
,
'email'
,
'cuil'
'cuil'
,
'es_usuario_boletin'
)
}),
(
_
(
'Organismo'
),
{
'fields'
:
(
'organismo'
,)}),
...
...
@@ -28,7 +29,7 @@ class UsuarioAdmin(UserAdmin):
(
None
,
{
'classes'
:
(
'wide'
,),
'fields'
:
(
'first_name'
,
'last_name'
,
'username'
,
"password1"
,
"password2"
,
'email'
,
'cuil'
,
'first_name'
,
'last_name'
,
'username'
,
"password1"
,
"password2"
,
'email'
,
'cuil'
,
'es_usuario_boletin'
,
'organismo'
,
'is_staff'
,)}
),
)
...
...
project/apps/usuario/migrations/0004_usuario_es_usuario_boletin.py
0 → 100644
View file @
4b2fed9
# Generated by Django 4.1.9 on 2023-09-12 13:16
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'usuario'
,
'0003_alter_usuario_cuil'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'usuario'
,
name
=
'es_usuario_boletin'
,
field
=
models
.
BooleanField
(
default
=
False
),
),
]
...
...
project/apps/usuario/models.py
View file @
4b2fed9
...
...
@@ -8,6 +8,7 @@ class Usuario(AbstractUser):
cuil
=
models
.
CharField
(
max_length
=
11
,
verbose_name
=
'Número de Cuil (Sin guiones)'
,
unique
=
True
)
organismo
=
models
.
ForeignKey
(
'organismo.Organismo'
,
on_delete
=
models
.
SET_NULL
,
blank
=
True
,
null
=
True
)
es_usuario_boletin
=
models
.
BooleanField
(
default
=
False
)
def
__str__
(
self
):
return
f
'{self.username}'
...
...
project/apps/usuario/serializers.py
View file @
4b2fed9
...
...
@@ -15,6 +15,7 @@ class UsuarioSerializer(serializers.ModelSerializer):
'last_name'
,
'email'
,
'cuil'
,
'es_usuario_boletin'
,
'organismo'
,
'permisos_usuario'
,
)
...
...
@@ -36,6 +37,7 @@ class UsuarioListaSerializer(serializers.ModelSerializer):
'first_name'
,
'last_name'
,
'cuil'
,
'es_usuario_boletin'
,
)
...
...
Please
register
or
login
to post a comment