Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Orbit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Applications
Orbit
Commits
84679636
Commit
84679636
authored
6 years ago
by
Alexandre Bourlier
Browse files
Options
Downloads
Patches
Plain Diff
server - updated python files
parent
715ab49a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/server/admin.py
+2
-1
2 additions, 1 deletion
src/server/admin.py
src/server/models.py
+20
-9
20 additions, 9 deletions
src/server/models.py
src/server/urls.py
+15
-5
15 additions, 5 deletions
src/server/urls.py
with
37 additions
and
15 deletions
src/server/admin.py
+
2
−
1
View file @
84679636
from
django.contrib
import
admin
from
.models
import
Member
,
Skill
,
Project
,
Client
,
Cell
,
Channel
from
.models
import
Member
,
Skill
,
Project
,
Client
,
Cell
,
Channel
,
Role
admin
.
site
.
register
(
Member
)
admin
.
site
.
register
(
Skill
)
...
...
@@ -7,3 +7,4 @@ admin.site.register(Project)
admin
.
site
.
register
(
Client
)
admin
.
site
.
register
(
Cell
)
admin
.
site
.
register
(
Channel
)
admin
.
site
.
register
(
Role
)
This diff is collapsed.
Click to expand it.
src/server/models.py
+
20
−
9
View file @
84679636
...
...
@@ -5,18 +5,22 @@ from django.dispatch import receiver
class
Member
(
models
.
Model
):
avatar
=
models
.
URLField
(
blank
=
True
)
available
=
models
.
NullBooleanField
(
blank
=
True
)
bio
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
cell
=
models
.
ForeignKey
(
"
Cell
"
,
on_delete
=
models
.
DO_NOTHING
,
blank
=
True
,
null
=
True
)
jabberID
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
jabberRoom
=
models
.
NullBooleanField
(
blank
=
True
)
user
=
models
.
OneToOneField
(
User
,
on_delete
=
models
.
CASCADE
)
avatar
=
models
.
URLField
()
firstname
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
lastname
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
email
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
number
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
cell
=
models
.
ForeignKey
(
"
Cell
"
,
on_delete
=
models
.
DO_NOTHING
,
blank
=
True
,
null
=
True
)
skills
=
models
.
ManyToManyField
(
"
Skill
"
,
blank
=
True
)
projects
=
models
.
ManyToManyField
(
"
Project
"
,
blank
=
True
)
pseudo
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
roles
=
models
.
ManyToManyField
(
"
Role
"
,
blank
=
True
)
skills
=
models
.
ManyToManyField
(
"
Skill
"
,
blank
=
True
)
website
=
models
.
URLField
(
blank
=
True
)
def
__str__
(
self
):
return
self
.
firstname
+
'
'
+
self
.
last
name
return
'
Profil de {}
'
.
format
(
self
.
user
.
get_full_
name
())
@receiver
(
post_save
,
sender
=
User
)
def
create_user_profile
(
sender
,
instance
,
created
,
**
kwargs
):
...
...
@@ -33,10 +37,17 @@ class Skill(models.Model):
return
self
.
name
class
Role
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
255
,
default
=
''
)
def
__str__
(
self
):
return
self
.
name
class
Project
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
255
,
default
=
''
)
number
=
models
.
PositiveIntegerField
(
default
=
'
0
'
)
client
=
models
.
OneToOneField
(
"
Client
"
,
on_delete
=
models
.
DO_NOTHING
)
number
=
models
.
PositiveIntegerField
(
default
=
'
0
'
,
blank
=
True
)
client
=
models
.
ForeignKey
(
"
Client
"
,
on_delete
=
models
.
DO_NOTHING
)
team
=
models
.
ManyToManyField
(
"
Member
"
,
blank
=
True
)
def
__str__
(
self
):
...
...
This diff is collapsed.
Click to expand it.
src/server/urls.py
+
15
−
5
View file @
84679636
...
...
@@ -15,16 +15,26 @@ Including another URLconf
"""
from
django.conf.urls
import
url
,
include
from
django.contrib
import
admin
from
django.views.generic
import
TemplateView
from
djangoldp.views
import
LDPViewSet
from
.models
import
Member
,
Skill
,
Project
,
Client
,
Cell
,
Channel
from
django.conf
import
settings
from
.models
import
Member
,
Skill
,
Project
,
Client
,
Cell
,
Channel
,
Role
from
.views
import
userinfocustom
urlpatterns
=
[
url
(
r
'
^$
'
,
TemplateView
.
as_view
(
template_name
=
"
index.html
"
),
name
=
"
index
"
),
url
(
r
'
^accounts/
'
,
include
(
'
django.contrib.auth.urls
'
)),
url
(
r
'
^admin/
'
,
admin
.
site
.
urls
),
url
(
r
'
^channels/
'
,
LDPViewSet
.
urls
(
model
=
Channel
,
nested_field
=
"
members
"
)),
url
(
r
'
^cells/
'
,
LDPViewSet
.
urls
(
model
=
Cell
)),
url
(
r
'
^clients/
'
,
LDPViewSet
.
urls
(
model
=
Client
)),
url
(
r
'
^members/
'
,
LDPViewSet
.
urls
(
model
=
Member
,
nested_field
=
"
skills
"
)),
url
(
r
'
^skills/
'
,
LDPViewSet
.
urls
(
model
=
Skill
)),
url
(
r
'
^projects/
'
,
LDPViewSet
.
urls
(
model
=
Project
,
nested_field
=
"
team
"
)),
url
(
r
'
^clients/
'
,
LDPViewSet
.
urls
(
model
=
Client
)),
url
(
r
'
^cells/
'
,
LDPViewSet
.
urls
(
model
=
Cell
)),
url
(
r
'
^channels/
'
,
LDPViewSet
.
urls
(
model
=
Channel
,
nested_field
=
"
members
"
)),
url
(
r
'
^skills/
'
,
LDPViewSet
.
urls
(
model
=
Skill
)),
url
(
r
'
^openid/userinfo
'
,
userinfocustom
),
url
(
r
'
^openid/
'
,
include
(
'
oidc_provider.urls
'
,
namespace
=
'
oidc_provider
'
)),
url
(
r
'
^role/
'
,
LDPViewSet
.
urls
(
model
=
Role
)),
url
(
r
'
^users/
'
,
LDPViewSet
.
urls
(
model
=
settings
.
AUTH_USER_MODEL
)),
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment