Skip to content

Commit

Permalink
Default for document date
Browse files Browse the repository at this point in the history
  • Loading branch information
nursix committed Feb 10, 2023
1 parent 503b674 commit 2630adf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nursix-dev-5584-g21b196ba5 (2023-02-10 14:28:10)
nursix-dev-5585-g503b674b1 (2023-02-10 14:44:14)
1 change: 1 addition & 0 deletions modules/s3db/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def model(self):
writable = False,
),
s3_date(label = T("Date Published"),
default = "now",
),
# @ToDo: Move location to link table
location_id(# Enable when-required
Expand Down
27 changes: 13 additions & 14 deletions modules/templates/RLPPTM/customise/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,23 @@ def doc_document_resource(r, tablename):

T = current.T

if r.controller == "org" or r.function == "organisation":
s3db = current.s3db
table = s3db.doc_document

s3db = current.s3db
table = s3db.doc_document
# Custom label for date-field, default not writable
field = table.date
field.label = T("Uploaded on")
field.writable = False

# Hide URL field
field = table.url
field.readable = field.writable = False
# Hide URL field
field = table.url
field.readable = field.writable = False

# Custom label for date-field
field = table.date
field.label = T("Uploaded on")
field.default = r.utcnow.date()
field.writable = False
# Custom label for name-field
field = table.name
field.label = T("Title")

# Custom label for name-field
field = table.name
field.label = T("Title")
if r.controller == "org" or r.function == "organisation":

# List fields
list_fields = ["name",
Expand Down

0 comments on commit 2630adf

Please sign in to comment.