May 2020
Intermediate to advanced
404 pages
10h 52m
English
We need to add the views to see all the bills on the billboard page. However, for this, we first need to create the model to hold all the bills.
In the models.py file, add the following code:
from django.utils.timezone import nowfrom django.contrib.auth.models import Userclass Bills(models.Model): billName = models.CharField("Bill Name", blank=False, max_length=100, default="New Bill") user = models.ForeignKey(User, on_delete=models.CASCADE) billDesc = models.TextField("Bill Description") billTime = models.DateTimeField(default=now, editable=False) class Meta: db_table = "bills"
In the preceding code, we created a new model called Bills. This will store the details for all of the bills added by users on the billboard. ...
Read now
Unlock full access