Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BDE
nk20
Commits
9ef0d542
Commit
9ef0d542
authored
Jul 08, 2019
by
Pierre-antoine Comby
Browse files
add profiles fields
parent
f8c972d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
adherents/models.py
View file @
9ef0d542
...
...
@@ -17,12 +17,28 @@ class Profile(models.Model):
We do not want to patch the Django Contrib Auth User class
so this model add an user profile with additional information.
"""
GENRES
=
[
(
None
,
"ND"
),
(
"M"
,
"M"
),
(
"F"
,
"F"
),
]
user
=
models
.
OneToOneField
(
settings
.
AUTH_USER_MODEL
,
on_delete
=
models
.
CASCADE
,
)
phone_numbe
r
=
models
.
Char
Field
(
avata
r
=
models
.
Image
Field
(
max_length
=
255
,
blank
=
True
,
verbose_name
=
_
(
'profile picture'
)
)
phone_number
=
models
.
CharField
(
max_length
=
50
,
blank
=
True
,
null
=
False
,
default
=
''
,
verbose_name
=
_
(
'phone number'
),
)
section
=
models
.
CharField
(
...
...
@@ -30,6 +46,25 @@ class Profile(models.Model):
verbose_name
=
_
(
'section'
),
help_text
=
_
(
'e.g. "1A0", "9A♥", "SAPHIRE"'
),
)
genre
=
models
.
CharField
(
max_length
=
1
,
blank
=
False
,
null
=
False
,
choices
=
GENRES
)
address
=
models
.
TextField
(
blank
=
True
,
null
=
False
,
default
=
''
)
remunere
=
models
.
BooleanField
(
verbose_name
=
_
(
"rémunéré"
),
default
=
False
,
)
is_active
=
models
.
BooleanField
(
verbose_name
=
_
(
"compte actif"
),
default
=
True
)
is_deleted
=
models
.
BooleanField
(
verbose_name
=
_
(
"compte supprimé"
),
default
=
False
)
class
Meta
:
verbose_name
=
_
(
'user profile'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment