Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
243eba2f
Commit
243eba2f
authored
4 years ago
by
Stephan Porada
Browse files
Options
Downloads
Patches
Plain Diff
Add new __repr__ function.
parent
6e81e424
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/models.py
+7
-7
7 additions, 7 deletions
app/models.py
with
7 additions
and
7 deletions
app/models.py
+
7
−
7
View file @
243eba2f
...
@@ -50,7 +50,7 @@ class Role(db.Model):
...
@@ -50,7 +50,7 @@ class Role(db.Model):
'''
'''
String representation of the Role. For human readability.
String representation of the Role. For human readability.
'''
'''
return
'
<Role
%r>
'
%
self
.
name
return
'
<Role
{role_name}>
'
.
format
(
role_name
=
self
.
name
)
def
add_permission
(
self
,
perm
):
def
add_permission
(
self
,
perm
):
'''
'''
...
@@ -151,7 +151,7 @@ class User(UserMixin, db.Model):
...
@@ -151,7 +151,7 @@ class User(UserMixin, db.Model):
'''
'''
String representation of the User. For human readability.
String representation of the User. For human readability.
'''
'''
return
'
<User
%r>
'
%
self
.
username
return
'
<User
{username}>
'
.
format
(
username
=
self
.
username
)
def
__init__
(
self
,
**
kwargs
):
def
__init__
(
self
,
**
kwargs
):
super
(
User
,
self
).
__init__
(
**
kwargs
)
super
(
User
,
self
).
__init__
(
**
kwargs
)
...
@@ -278,7 +278,7 @@ class JobInput(db.Model):
...
@@ -278,7 +278,7 @@ class JobInput(db.Model):
'''
'''
String representation of the JobInput. For human readability.
String representation of the JobInput. For human readability.
'''
'''
return
'
<JobInput
%r>
'
%
self
.
filename
return
'
<JobInput
{filename}>
'
.
format
(
filename
=
self
.
filename
)
def
to_dict
(
self
):
def
to_dict
(
self
):
return
{
'
id
'
:
self
.
id
,
return
{
'
id
'
:
self
.
id
,
...
@@ -303,7 +303,7 @@ class JobResult(db.Model):
...
@@ -303,7 +303,7 @@ class JobResult(db.Model):
'''
'''
String representation of the JobResult. For human readability.
String representation of the JobResult. For human readability.
'''
'''
return
'
<JobResult
%r>
'
%
self
.
filename
return
'
<JobResult
{filename}>
'
.
format
(
filename
=
self
.
filename
)
def
to_dict
(
self
):
def
to_dict
(
self
):
return
{
'
id
'
:
self
.
id
,
return
{
'
id
'
:
self
.
id
,
...
@@ -353,7 +353,7 @@ class Job(db.Model):
...
@@ -353,7 +353,7 @@ class Job(db.Model):
'''
'''
String representation of the Job. For human readability.
String representation of the Job. For human readability.
'''
'''
return
'
<Job
%r>
'
%
self
.
title
return
'
<Job
{job_title}>
'
.
format
(
job_title
=
self
.
title
)
def
create_secure_filename
(
self
):
def
create_secure_filename
(
self
):
'''
'''
...
@@ -410,7 +410,7 @@ class NotificationData(db.Model):
...
@@ -410,7 +410,7 @@ class NotificationData(db.Model):
'''
'''
String representation of the NotificationData. For human readability.
String representation of the NotificationData. For human readability.
'''
'''
return
'
<NotificationData
%r>
'
%
self
.
id
# TODO: Why not .format()?
return
'
<NotificationData
{id}>
'
.
format
(
id
=
self
.
id
)
def
to_dict
(
self
):
def
to_dict
(
self
):
return
{
'
id
'
:
self
.
id
,
return
{
'
id
'
:
self
.
id
,
...
@@ -537,7 +537,7 @@ class Corpus(db.Model):
...
@@ -537,7 +537,7 @@ class Corpus(db.Model):
'''
'''
String representation of the corpus. For human readability.
String representation of the corpus. For human readability.
'''
'''
return
'
<Corpus
%r>
'
%
self
.
title
return
'
<Corpus
{corpus_title}>
'
.
format
(
corpus_title
=
self
.
title
)
'''
'''
...
...
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