Skip to content

Commit

Permalink
SAFIRE: Prototype complete...for now
Browse files Browse the repository at this point in the history
  • Loading branch information
flavour committed Dec 8, 2017
1 parent d0acef4 commit 9c03b4a
Show file tree
Hide file tree
Showing 13 changed files with 488 additions and 144 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7fc4f51 (2017-12-07 20:33:01)
d0acef4 (2017-12-08 14:00:30)
20 changes: 15 additions & 5 deletions controllers/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,16 @@ def prep(r):

# Default Event in the link to that of the Incident
ltable = s3db.table("event_%s" % cname)
if ltable and "event_id" in ltable.fields:
if ltable:
f = ltable.event_id
f.default = r.record.event_id
f.readable = f.writable = False
if cname in ("asset", "human_resource"):
# DateTime
for f in (ltable.start_date, ltable.end_date):
f.requires = IS_EMPTY_OR(IS_UTC_DATETIME())
f.represent = lambda dt: S3DateTime.datetime_represent(dt, utc=True)
f.widget = S3CalendarWidget(timepicker = True)

elif cname == "incident_asset":

Expand All @@ -164,10 +170,14 @@ def prep(r):

# Default Event in the link to that of the Incident
ltable = s3db.table("event_asset")
if ltable and "event_id" in ltable.fields:
f = ltable.event_id
f.default = r.record.event_id
f.readable = f.writable = False
f = ltable.event_id
f.default = r.record.event_id
f.readable = f.writable = False
# DateTime
for f in (ltable.start_date, ltable.end_date):
f.requires = IS_EMPTY_OR(IS_UTC_DATETIME())
f.represent = lambda dt: S3DateTime.datetime_represent(dt, utc=True)
f.widget = S3CalendarWidget(timepicker = True)

elif r.method not in ("read", "update"):
# Create or ListCreate
Expand Down
Loading

0 comments on commit 9c03b4a

Please sign in to comment.