From bb24a5172c324eb510bc8480724e2ca0416ec851 Mon Sep 17 00:00:00 2001 From: Daniel Tsvetkov Date: Tue, 11 Aug 2020 13:17:53 +0200 Subject: [PATCH] created_dt is separate --- sensitive_dev.py | 1 + webapp/models/_blog_post.py | 6 ++++-- webapp/templates/blog_post/_create.html | 14 ++++++++++++++ webapp/templates/blog_post/_get.html | 6 ++++++ webapp/templates/blog_post/_table.html | 16 ++++++++++++++++ webapp/templates/blog_post/_update.html | 16 ++++++++++++++++ webapp/view_models/BlogPost.yaml | 5 +++-- 7 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 sensitive_dev.py diff --git a/sensitive_dev.py b/sensitive_dev.py new file mode 100644 index 0000000..d7a8fc3 --- /dev/null +++ b/sensitive_dev.py @@ -0,0 +1 @@ +ADMIN_PASSWORD = "password" diff --git a/webapp/models/_blog_post.py b/webapp/models/_blog_post.py index 5126694..0a0ccef 100644 --- a/webapp/models/_blog_post.py +++ b/webapp/models/_blog_post.py @@ -1,12 +1,14 @@ -from oshipka.persistance import db, ModelController, index_service, LiberalBoolean, Ownable, Datable +from oshipka.persistance import db, ModelController, index_service, LiberalBoolean, Ownable -class BlogPost(db.Model, ModelController, Ownable, Datable): +class BlogPost(db.Model, ModelController, Ownable): __searchable__ = ['body', ] filename = db.Column(db.UnicodeText,) title = db.Column(db.UnicodeText,) body = db.Column(db.UnicodeText,) + created_dt = db.Column(db.UnicodeText,) + updated_dt = db.Column(db.UnicodeText,) index_service.searchables.append(BlogPost) diff --git a/webapp/templates/blog_post/_create.html b/webapp/templates/blog_post/_create.html index 554e444..132a4cb 100644 --- a/webapp/templates/blog_post/_create.html +++ b/webapp/templates/blog_post/_create.html @@ -21,6 +21,20 @@ + + : + + + + + : + + + \ No newline at end of file diff --git a/webapp/templates/blog_post/_get.html b/webapp/templates/blog_post/_get.html index 6970474..a925ddf 100644 --- a/webapp/templates/blog_post/_get.html +++ b/webapp/templates/blog_post/_get.html @@ -7,4 +7,10 @@ {% endif %} {% if "body" not in skip_list %}
  • {{ _("body") }}: {{ instance.body }}
  • +{% endif %} +{% if "created_dt" not in skip_list %} +
  • {{ _("created_dt") }}: {{ instance.created_dt }}
  • +{% endif %} +{% if "updated_dt" not in skip_list %} +
  • {{ _("updated_dt") }}: {{ instance.updated_dt }}
  • {% endif %} \ No newline at end of file diff --git a/webapp/templates/blog_post/_table.html b/webapp/templates/blog_post/_table.html index 6915211..7dd56e2 100644 --- a/webapp/templates/blog_post/_table.html +++ b/webapp/templates/blog_post/_table.html @@ -10,6 +10,12 @@ {% if "body" not in skip_columns %} {{ _("body") }} {% endif %} + {% if "created_dt" not in skip_columns %} + {{ _("created_dt") }} + {% endif %} + {% if "updated_dt" not in skip_columns %} + {{ _("updated_dt") }} + {% endif %} {{ _("Actions") }} @@ -31,6 +37,16 @@ {{ instance.body }} {% endif %} + {% if "created_dt" not in skip_columns %} + + {{ instance.created_dt }} + + {% endif %} + {% if "updated_dt" not in skip_columns %} + + {{ instance.updated_dt }} + + {% endif %} e | x diff --git a/webapp/templates/blog_post/_update.html b/webapp/templates/blog_post/_update.html index 3094ff9..4f0eb4a 100644 --- a/webapp/templates/blog_post/_update.html +++ b/webapp/templates/blog_post/_update.html @@ -23,6 +23,22 @@ + + : + + + + + : + + + \ No newline at end of file diff --git a/webapp/view_models/BlogPost.yaml b/webapp/view_models/BlogPost.yaml index 8a137d8..eb9071a 100644 --- a/webapp/view_models/BlogPost.yaml +++ b/webapp/view_models/BlogPost.yaml @@ -3,7 +3,6 @@ searchable: - body interits: - Ownable - - Datable access: - verb: all login_required: true @@ -21,4 +20,6 @@ columns: - name: filename - name: title - name: body - type: long_text \ No newline at end of file + type: long_text + - name: created_dt + - name: updated_dt \ No newline at end of file