From 84ea0b4d083209963d246c30d87eac4c906bada0 Mon Sep 17 00:00:00 2001 From: Esther Kleinhenz Date: Thu, 5 Jul 2018 15:51:43 +0200 Subject: [PATCH] code editing --- application/models.py | 6 +-- application/templates/base.html | 87 ++++++++++++++++---------------- application/templates/index.html | 2 +- user.json | 22 +++++++- 4 files changed, 69 insertions(+), 48 deletions(-) diff --git a/application/models.py b/application/models.py index e9c835b..a4b8aef 100644 --- a/application/models.py +++ b/application/models.py @@ -7,10 +7,10 @@ class Post(models.Model): title = models.CharField(max_length=200) text = models.TextField() created_date = models.DateTimeField( - default=timezone.now) + default=timezone.now) published_date = models.DateTimeField( - blank=True, null=True) - + blank=True, null=True) + def publish(self): self.published_date = timezone.now() self.save() diff --git a/application/templates/base.html b/application/templates/base.html index e6f0b90..e43f79e 100644 --- a/application/templates/base.html +++ b/application/templates/base.html @@ -1,6 +1,7 @@ {% load static %} + @@ -8,6 +9,7 @@ + @@ -18,61 +20,59 @@ efi - @@ -82,4 +82,5 @@ + \ No newline at end of file diff --git a/application/templates/index.html b/application/templates/index.html index ca0d197..899757f 100644 --- a/application/templates/index.html +++ b/application/templates/index.html @@ -6,7 +6,7 @@

efi Medizintechnik Informationssystem

{% if user.is_authenticated %} -

Herzlich Willkommen!

+

Herzlich Willkommen {{user.get_username}}!

{% else %}

Bitte melden Sie sich mit Ihrer Domänenkennung an.

{% endif %} diff --git a/user.json b/user.json index 91d0b46..fe5c84e 100644 --- a/user.json +++ b/user.json @@ -6,7 +6,7 @@ "pk": 1, "fields": { "password": "pbkdf2_sha256$100000$pu4yd74Yw8vd$cpecLMlMn0/X2vPqQb2U7QFyjq939RFiXHVECRFtaVU=", - "last_login": "2018-07-01T10:45:39.649Z", + "last_login": "2018-07-01T13:56:56.740Z", "is_superuser": true, "username": "esthi", "first_name": "", @@ -72,5 +72,25 @@ "groups": [], "user_permissions": [] } + }, + { + "model": "auth.user", + "pk": 5, + "fields": { + "password": "pbkdf2_sha256$100000$JfhBNx94qFkw$b0Zefa6oyWN4P8NoZ0vxUlGJp4HkOKSDOR7mROjHuJQ=", + "last_login": null, + "is_superuser": false, + "username": "willsmith", + "first_name": "", + "last_name": "", + "email": "", + "is_staff": false, + "is_active": true, + "date_joined": "2018-07-01T14:00:11Z", + "groups": [ + 1 + ], + "user_permissions": [] + } } ] \ No newline at end of file