Created
November 24, 2012 17:04
-
-
Save Pycz/4140528 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def b(request): | |
template = Template('b.html') | |
test = models.Model() | |
tread = models.Tread(1, models.now_timestamp()) | |
testlist = test.get_all_records_from(tread) | |
#testlist = [models.Record(*[x for x in item]) for item in testlist] | |
context = Context({'lol': testlist}) | |
result = template.render(context) | |
return HttpResponse(result) | |
def get_all_records_from(self, tread, board = "B"): | |
its_records = "records" + board | |
#its_treads = "treads" + board | |
self.cur.execute( | |
""" | |
SELECT * FROM (%s) WHERE tread_id = (:tread_id) | |
""" % its_records, {"tread_id": str(tread.id)} | |
) | |
return self._list_of_tuple_to_list_of_obj(self.cur.fetchall(), Record) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment