Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djangoldp-profile
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
djangoldp-packages
djangoldp-profile
Merge requests
!9
Make profile Inherit djangoldp.Model
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Make profile Inherit djangoldp.Model
2-inherit-model
into
master
Overview
2
Commits
1
Pipelines
1
Changes
1
Merged
Ghost User
requested to merge
2-inherit-model
into
master
5 years ago
Overview
2
Commits
1
Pipelines
1
Changes
1
Expand
Closes
#2 (closed)
Edited
5 years ago
by
Ghost User
0
0
Merge request reports
Viewing commit
870d4589
Show latest version
1 file
+
4
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
870d4589
update: make Profile inherit djangoldp.Model. may fix
#2
· 870d4589
Jean-Baptiste
authored
5 years ago
djangoldp_profile/models.py
+
4
−
6
Options
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse_lazy
from
django.db
import
models
from
django.db.models.signals
import
post_save
from
django.dispatch
import
receiver
from
django.core.urlresolvers
import
reverse_lazy
from
djangoldp.models
import
Model
class
Profile
(
models
.
Model
):
class
Profile
(
Model
):
user
=
models
.
OneToOneField
(
settings
.
AUTH_USER_MODEL
,
on_delete
=
models
.
CASCADE
)
available
=
models
.
NullBooleanField
(
blank
=
True
)
bio
=
models
.
CharField
(
max_length
=
150
,
blank
=
True
)
@@ -27,10 +29,6 @@ class Profile(models.Model):
)
depth
=
0
def
get_absolute_url
(
self
):
return
reverse_lazy
(
'
profile-detail
'
,
kwargs
=
{
'
pk
'
:
self
.
pk
})
def
__str__
(
self
):
return
'
{} ({})
'
.
format
(
self
.
user
.
get_full_name
(),
self
.
user
.
username
)
Loading