Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
m3_webInterface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
m3
m3_webInterface
Commits
721221ba
Commit
721221ba
authored
Aug 24, 2018
by
Mario Chirinos Colunga
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
report
parent
d6ea5710
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
1 deletion
+33
-1
updateDB.cpython-36.pyc
...g/management/commands/__pycache__/updateDB.cpython-36.pyc
+0
-0
report.py
catalog/management/commands/report.py
+32
-0
report.pyc
catalog/management/commands/report.pyc
+0
-0
updateDB.py
catalog/management/commands/updateDB.py
+1
-1
views.pyc
catalog/views.pyc
+0
-0
No files found.
catalog/management/commands/__pycache__/updateDB.cpython-36.pyc
View file @
721221ba
No preview for this file type
catalog/management/commands/report.py
0 → 100644
View file @
721221ba
from
django.core.management.base
import
BaseCommand
,
CommandError
from
catalog.models
import
User
,
News
,
Publisher
,
Topic
,
audioTime
from
django.db.models
import
Q
import
os
import
json
class
Command
(
BaseCommand
):
help
=
'Report database'
# def add_arguments(self, parser):
# parser.add_argument('basedir', nargs=1, type=str) #(options['basedir'][0]
def
handle
(
self
,
*
args
,
**
options
):
print
(
"Users: "
+
str
(
User
.
objects
.
all
()
.
count
())
)
print
(
"Publishers: "
+
str
(
Publisher
.
objects
.
all
()
.
count
())
)
print
(
"
\t
Text: "
+
str
(
Publisher
.
objects
.
all
()
.
filter
(
type
=
"texto"
)
.
count
())
)
print
(
"
\t\t
Documents: "
+
"{:,}"
.
format
(
News
.
objects
.
all
()
.
count
())
)
print
(
"
\t
Audio: "
+
str
(
Publisher
.
objects
.
all
()
.
filter
(
type
=
"audio"
)
.
count
())
)
minutes
=
sum
([
a
.
minutes
for
a
in
audioTime
.
objects
.
all
()])
print
(
"
\t\t
Recorders hours: "
+
"{:,}"
.
format
(
minutes
/
60.
)
)
print
(
"======================================================="
)
textSources
=
Publisher
.
objects
.
all
()
.
filter
(
type
=
"texto"
)
for
t
in
textSources
:
print
(
t
.
name
+
", "
+
t
.
url
+
", "
+
str
(
News
.
objects
.
all
()
.
filter
(
publisher
=
t
)
.
count
())
)
print
(
"======================================================="
)
audioSources
=
Publisher
.
objects
.
all
()
.
filter
(
type
=
"audio"
)
for
a
in
audioSources
:
print
(
a
.
name
+
", "
+
a
.
url
+
", "
+
str
(
audioTime
.
objects
.
all
()
.
filter
(
publisher
=
a
)[
0
]
.
minutes
))
catalog/management/commands/report.pyc
0 → 100644
View file @
721221ba
File added
catalog/management/commands/updateDB.py
View file @
721221ba
...
@@ -18,7 +18,7 @@ class Command(BaseCommand):
...
@@ -18,7 +18,7 @@ class Command(BaseCommand):
def
handle
(
self
,
*
args
,
**
options
):
def
handle
(
self
,
*
args
,
**
options
):
if
Fals
e
:
if
Tru
e
:
#update radio stations recotding time
#update radio stations recotding time
print
(
"Recording Time:"
)
print
(
"Recording Time:"
)
recordingsDir
=
"/home/mario/virtualHDD/m3/recordings/"
recordingsDir
=
"/home/mario/virtualHDD/m3/recordings/"
...
...
catalog/views.pyc
View file @
721221ba
No preview for this file type
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