Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PEDASI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Research Software Group
PEDASI
Commits
8ccd0eb1
Commit
8ccd0eb1
authored
6 years ago
by
James Graham
Browse files
Options
Downloads
Patches
Plain Diff
Add documentation to User, Application and DataSource classes
parent
520d8f1f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
applications/models.py
+13
-0
13 additions, 0 deletions
applications/models.py
datasources/models.py
+15
-0
15 additions, 0 deletions
datasources/models.py
profiles/models.py
+4
-0
4 additions, 0 deletions
profiles/models.py
with
32 additions
and
0 deletions
applications/models.py
+
13
−
0
View file @
8ccd0eb1
...
@@ -3,17 +3,30 @@ from django.db import models
...
@@ -3,17 +3,30 @@ from django.db import models
from
django.urls
import
reverse
from
django.urls
import
reverse
#: Length of CharFields used to hold the names of objects
MAX_LENGTH_NAME
=
63
MAX_LENGTH_NAME
=
63
class
Application
(
models
.
Model
):
class
Application
(
models
.
Model
):
"""
Manage the state of and access to an external application.
An external application may be e.g.:
* A data / metadata visualisation tool
* A data / metadata analysis pipeline
"""
#: Friendly name of this application
name
=
models
.
CharField
(
max_length
=
MAX_LENGTH_NAME
,
name
=
models
.
CharField
(
max_length
=
MAX_LENGTH_NAME
,
blank
=
False
,
null
=
False
)
blank
=
False
,
null
=
False
)
#: A brief description
description
=
models
.
TextField
(
blank
=
True
,
null
=
False
)
description
=
models
.
TextField
(
blank
=
True
,
null
=
False
)
#: Address at which the API may be accessed
url
=
models
.
URLField
(
blank
=
False
,
null
=
False
)
url
=
models
.
URLField
(
blank
=
False
,
null
=
False
)
#: User who has responsibility for this application
owner
=
models
.
ForeignKey
(
settings
.
AUTH_USER_MODEL
,
owner
=
models
.
ForeignKey
(
settings
.
AUTH_USER_MODEL
,
limit_choices_to
=
{
limit_choices_to
=
{
'
groups__name
'
:
'
Application providers
'
'
groups__name
'
:
'
Application providers
'
...
...
This diff is collapsed.
Click to expand it.
datasources/models.py
+
15
−
0
View file @
8ccd0eb1
...
@@ -3,17 +3,32 @@ from django.db import models
...
@@ -3,17 +3,32 @@ from django.db import models
from
django.urls
import
reverse
from
django.urls
import
reverse
#: Length of CharFields used to hold the names of objects
MAX_LENGTH_NAME
=
63
MAX_LENGTH_NAME
=
63
class
DataSource
(
models
.
Model
):
class
DataSource
(
models
.
Model
):
"""
Manage access to a data source API.
Will provide functionality to:
* Query data (with query params)
* Query metadata (with query params)
* Track provenance of the data source itself
* Track provenance of data accesses
"""
#: Friendly name of this data source
name
=
models
.
CharField
(
max_length
=
MAX_LENGTH_NAME
,
name
=
models
.
CharField
(
max_length
=
MAX_LENGTH_NAME
,
blank
=
False
,
null
=
False
)
blank
=
False
,
null
=
False
)
#: A brief description
description
=
models
.
TextField
(
blank
=
True
,
null
=
False
)
description
=
models
.
TextField
(
blank
=
True
,
null
=
False
)
#: Address at which the API may be accessed
url
=
models
.
URLField
(
blank
=
False
,
null
=
False
)
url
=
models
.
URLField
(
blank
=
False
,
null
=
False
)
#: User who has responsibility for this data source
owner
=
models
.
ForeignKey
(
settings
.
AUTH_USER_MODEL
,
owner
=
models
.
ForeignKey
(
settings
.
AUTH_USER_MODEL
,
limit_choices_to
=
{
limit_choices_to
=
{
'
groups__name
'
:
'
Data providers
'
'
groups__name
'
:
'
Data providers
'
...
...
This diff is collapsed.
Click to expand it.
profiles/models.py
+
4
−
0
View file @
8ccd0eb1
...
@@ -2,4 +2,8 @@ from django.contrib.auth.models import AbstractUser
...
@@ -2,4 +2,8 @@ from django.contrib.auth.models import AbstractUser
class
User
(
AbstractUser
):
class
User
(
AbstractUser
):
"""
Custom Django user model to allow for additional functionality to be
added more easily in the future.
"""
pass
pass
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