I am coding a basic django application that will show a table of current store sales, based off of information from a MariaDB database.
The data is entered into the dat
The storeid
field on the ShowroomData model of actually a foreign key. So you should declare it as such:
class ShowroomData(models.Model):
store = models.ForeignKey("Stores", db_column="storeid")
Now you can follow that fk in your template. Assuming current_showroom
is a queryset of ShowroomData instances:
{% for store in current_showroom %}
{{ store.storeid }}
{{ store.store.name }}
{% endfor %}