示例#1
0
文件: first.py 项目: Pycz/PyImgBoard
def board(request, name):
    model = models.Model()
    all_categorys = model.get_all_categorys()
    all_boards = []
    for category in all_categorys:
        boards_from = model.get_all_boards_from_category(category)
        all_boards += boards_from

    board = model.get_board_by_adr(adr=name)
    all_treads = model.get_all_treads_by_date(board)
    
    class obert():
        def __init__(self, mid, name):
            self.id = mid
            self.name = name
           
    id_all_treads = [x.id for x in all_treads]
    treads = []
    for tread in all_treads:
        treads.append(obert(tread.id, 
                            model.get_all_records_from(tread, board)))

    template = Template('boards.html')
    context = Context({'treads': treads, 'board': board, 
                       'all_boards': all_boards})
    return HttpResponse(template.render(context))
示例#2
0
def board(request, name):
    model = models.Model()
    all_categorys = model.get_all_categorys()
    all_boards = []
    for category in all_categorys:
        boards_from = model.get_all_boards_from_category(category)
        all_boards += boards_from

    board = model.get_board_by_adr(adr=name)
    all_treads = model.get_all_treads_by_date(board)

    class obert():
        def __init__(self, mid, name):
            self.id = mid
            self.name = name
           
    id_all_treads = [x.id for x in all_treads]
    treads = []
    for tread in all_treads:
        treads.append(obert(tread.id, 
                            model.get_all_records_from(tread, board)))

    template = Template('boards.html')
    context = Context({'treads': treads, 'board': board, 
                       'all_boards': all_boards})
    return HttpResponse(template.render(context))
示例#3
0
文件: first.py 项目: Pycz/PyImgBoard
def b(request):
    template = Template('b.html')
    test = models.Model()
    tread = models.Tread(1, now_timestamp())
    testlist = test.get_all_records_from(tread)
    context = Context({'lol': testlist})
    result = template.render(context)
    return HttpResponse(result)
示例#4
0
def b(request):
    template = Template('b.html')
    test = models.Model()
    tread = models.Tread(1, now_timestamp())
    testlist = test.get_all_records_from(tread)
    context = Context({'lol': testlist})
    result = template.render(context)
    return HttpResponse(result)
示例#5
0
文件: first.py 项目: Pycz/PyImgBoard
def index(request):
    model = models.Model()
    categ = model.get_all_categorys()
    newcateg = []
    for cat in categ:
        catboard = model.get_all_boards_from_category(cat)
        newcateg.append({cat.name: catboard})
        
    template = Template('index.html')
    con = {"categorys": categ, "categ_list": newcateg, 'welcome_text': 'Welcome back. Again.'}
    context = Context(con)
    result = template.render(context)
    return HttpResponse(result)
示例#6
0
def index(request):
    model = models.Model()
    categ = model.get_all_categorys()
    newcateg = []
    for cat in categ:
        catboard = model.get_all_boards_from_category(cat)
        newcateg.append({cat.name: catboard})
        
    template = Template('index.html')
    con = {"categorys": categ, "categ_list": newcateg, 'welcome_text': 'Welcome back. Again.'}
    context = Context(con)
    result = template.render(context)
    return HttpResponse(result)
示例#7
0
文件: first.py 项目: Pycz/PyImgBoard
def tread(request, board_adr, tread_id):
    model = models.Model()
    all_categorys = model.get_all_categorys()
    all_boards = []
    for category in all_categorys:
        boards_from = model.get_all_boards_from_category(category)
        all_boards += boards_from

    board = model.get_board_by_adr(adr=board_adr)
    tread = model.get_tread_by_id(tread_id, board=board)    
    posts = model.get_all_records_from(tread, board)
    template = Template('tread.html')
    context = Context({'board': board,'tread': tread, 
                       'posts': posts, 'all_boards': all_boards})
    return HttpResponse(template.render(context))
示例#8
0
def tread(request, board_adr, tread_id):
    model = models.Model()
    all_categorys = model.get_all_categorys()
    all_boards = []
    for category in all_categorys:
        boards_from = model.get_all_boards_from_category(category)
        all_boards += boards_from

    board = model.get_board_by_adr(adr=board_adr)
    tread = model.get_tread_by_id(tread_id, board=board)    
    posts = model.get_all_records_from(tread, board)
    template = Template('tread.html')
    context = Context({'board': board,'tread': tread, 
                       'posts': posts, 'all_boards': all_boards})
    return HttpResponse(template.render(context))
示例#9
0
文件: first.py 项目: Pycz/PyImgBoard
def test(request):
    template = Template('addtread.html')
    context = Context({})
    result = template.render(context)
    return HttpResponse(result)
示例#10
0
文件: first.py 项目: Pycz/PyImgBoard
def faq(request):
    template = Template('faq.html')
    context = Context({'s': 'gogog ogogog'})
    result = template.render(context)
    return HttpResponse(result)
示例#11
0
def test(request):
    template = Template('addtread.html')
    context = Context({})
    result = template.render(context)
    return HttpResponse(result)
示例#12
0
def faq(request):
    template = Template('faq.html')
    context = Context({'s': 'gogog ogogog'})
    result = template.render(context)
    return HttpResponse(result)