Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
energy
bmon
Commits
2cea3533
Commit
2cea3533
authored
Oct 29, 2016
by
Alan Mitchell
Browse files
Made Admin Interface for Periodic Script.
parent
51ffe675
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
bmsapp/admin.py
bmsapp/admin.py
+9
-1
No files found.
bmsapp/admin.py
View file @
2cea3533
...
...
@@ -5,7 +5,7 @@ This file configures the Admin interface, which allows for editing of the Models
from
bmsapp.models
import
Building
,
Sensor
,
SensorGroup
,
BldgToSensor
,
DashboardItem
,
Unit
from
bmsapp.models
import
MultiBuildingChart
,
ChartBuildingInfo
from
bmsapp.models
import
BuildingGroup
,
BuildingMode
from
bmsapp.models
import
AlertCondition
,
AlertRecipient
from
bmsapp.models
import
AlertCondition
,
AlertRecipient
,
PeriodicScript
from
django.contrib
import
admin
from
django.forms
import
TextInput
,
Textarea
from
django.db
import
models
...
...
@@ -194,3 +194,11 @@ class AlertRecipientAdmin(admin.ModelAdmin):
(
'notify_cell'
,
'cell_number'
,
'cell_sms_gateway'
),
(
'notify_pushover'
,
'pushover_id'
)
)
@
admin
.
register
(
PeriodicScript
)
class
SensorAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'script_file_name'
,
'script_parameters'
,
'period'
)
readonly_fields
=
(
'script_results'
,)
formfield_overrides
=
{
models
.
TextField
:
{
'widget'
:
Textarea
(
attrs
=
{
'rows'
:
8
,
'cols'
:
80
})},
}
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