Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
logs-viewer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tools
logs-viewer
Commits
929bcebb
Commit
929bcebb
authored
Jun 05, 2016
by
Maxime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a better str function for models
parent
b3034e54
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
logs_viewer/models.py
+8
-2
No files found.
logs_viewer/models.py
View file @
929bcebb
...
...
@@ -4,6 +4,9 @@ from django.db import models
class
LoggedApplication
(
models
.
Model
):
name
=
models
.
CharField
(
blank
=
False
,
max_length
=
80
)
def
__str__
(
self
):
return
self
.
name
class
LogViewer
(
models
.
Model
):
application
=
models
.
ForeignKey
(
'LoggedApplication'
,
on_delete
=
models
.
CASCADE
,
related_name
=
'logs'
)
...
...
@@ -12,4 +15,7 @@ class LogViewer(models.Model):
def
set_content
(
self
):
f
=
open
(
self
.
path
,
'r'
)
self
.
content
=
list
(
f
)
\ No newline at end of file
self
.
content
=
list
(
f
)
def
__str__
(
self
):
return
self
.
name
\ No newline at end of file
Write
Preview
Markdown
is supported
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