I'm writing an order queue system using django and I've been able to figure out how to get input from HTML forms and store it into an sqlite database using models and forms. To read data from the database into a list I do something like this
queueList = Order.objects.filter(orderDate__isnull=True)
(html output of {{queueList}})
Where Order is a model with a number of attributes. The data returned looks something like this.
[<Order: Name: Bob, Catalog #: 32, Vendor: vendor1, Site: Site1, Entered: 2011-06-06, Ordered: None, Received: None, Ordered By: orderee1>, <Order: Name: Jeff, Catalog #: 333, Vendor: vendor2, Site: site2, Entered: 2011-06-06, Ordered: None, Received: None, Ordered By: orderee2>]
It feels like there would be something simple built into django to format this as an HTML table, kind of like form.as_table. Is there any easy way to do this? I need to display 3 tables, first prints out every dictionary item that has no orderDate, the second is every item that as orderDate but no receivedDate, and the third is a table that has all receivedDates. Am I going to have to actually chop up all this data in order to construct a table? I found some code online of someone who tried something similar but it was throwing exceptions and was too complex for me to fix.