Django Vorlage nicht Modelldaten anzeigt, zeigt leere Seite ... Werfen Sie einen Blick auf sie:Django Vorlage nicht Modelldaten anzeigt, leere Seite
models.py
class appointment(models.Model):
patient_name1= models.ForeignKey('identity')
appoint_date= models.DateTimeField('Appoinment time and date')
patient_info= models.TextField()
fees= models.CharField('Fees',max_length=100,blank=True)
class Meta:
verbose_name = 'Appointment Detail'
verbose_name_plural = 'Appoinment Details'
ordering = ['appoint_date']
def __str__(self):
return '%s (%s)' % (self. patient_name1, self.appoint_date)
views.py
from django.shortcuts import render
from .models import identity, appointment
def index(request):
return render(request, 'appoint/index.html')
def appointment_list(request):
Appointments = appointment.objects.all()
context = {'Appointments': Appointments}
return render(request, 'appoint/appointment_list.html', context)
appointment_list.html
<p>{{Appointments.patient_name1}}</p>
urls.py
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^appointment_list/$', views.appointment_list, name='appointment_list'),
url(r'^aboutme/$', views.aboutme, name='about_us'),
url(r'^contact/$', views.contact, name='contact_us'),
url(r'^apply_appoint/$', views.apply_appoint, name='apply_appoint'),
]
mir bitte helfen, ich bin neu 1,9
Verstanden ....... Ich Verbesserung der Klassennamen machen ..... Danke für den Rat –