Zwischenstand des Praktikums: index-Fkt muss noch angepasst werden!
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
class Notice(models.Model):
|
||||
|
||||
#def __init__(self):
|
||||
#self.id = super().id
|
||||
|
||||
notice_title = models.CharField(max_length = 80)
|
||||
notice_text = models.CharField(max_length = 400)
|
||||
pub_start = models.DateTimeField()
|
||||
pub_end = models.DateTimeField()
|
||||
|
||||
@@ -4,4 +4,10 @@ from django.http import HttpResponse
|
||||
# Create your views here.
|
||||
|
||||
def index(request):
|
||||
return render(request, 'posts/index.html')
|
||||
#return render(request, 'posts/index.html')
|
||||
|
||||
#context = # hier muss Datenbank ausgelesen werden:
|
||||
# for curr_msg in Notice.objects.all():
|
||||
# if (curr_msg.pub_start > datetime.now() and curr_msg.pub_end < date......
|
||||
# context +=
|
||||
return render(request, 'posts/allMessages.html')
|
||||
|
||||
Reference in New Issue
Block a user