| Home | Trees | Indices | Help |
|---|
|
|
1 ###########################################################################
2 # #
3 # Copyright (C) 2016 Rafal Kobel <rafyco1@gmail.com> #
4 # #
5 # This program is free software: you can redistribute it and/or modify #
6 # it under the terms of the GNU General Public License as published by #
7 # the Free Software Foundation, either version 3 of the License, or #
8 # (at your option) any later version. #
9 # #
10 # This program is distributed in the hope that it will be useful, #
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
13 # GNU General Public License for more details. #
14 # #
15 # You should have received a copy of the GNU General Public License #
16 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
17 # #
18 ###########################################################################
19 """
20 Modul obslugujacy strone z lista elementow.
21
22 Obiekt obsluguje strone z lista elementow. Moga one pochodzic zarowno
23 z pojedynczej tabeli jak i jako wynik zapytania SQL.
24
25 Obiekt Generujacy
26 =================
27
28 L{ajango.generator.views.list}
29 """
30
31 from __future__ import print_function
32 from ajango.site.sites import SiteBase
33 from ajango.database.columns import column_factory
34
36 """
37 Wyswietlenie informacji debugowej. Funkcja opcjonalna.
38
39 Aby uzyc nalezy zmienic wartosc wewnatrz instrukcji C{if} z C{False}
40 na C{True}.
41 """
42 if False:
43 print(text)
44
46 """ Klasa obslugujaca strone tabeli z lista elementow. """
59 """ Dodanie nowej kolumny do wyswietlenia. """
60 col = column_factory(param)
61 self.column.append(col)
66 """ Ustawienie zmiennych dostarczanych do szablonow. """
67 self.data['tableheader'] = []
68 for col in self.column:
69 self.data['tableheader'].append(col.get_label())
70 data = []
71 results = self.query.get_all()
72 print_debug("======== Column list ===============")
73 for elem in results:
74 line = []
75 for col in self.column:
76 line.append(col.get_data({'result' : elem}))
77 print_debug(line)
78 print_debug("------------------------------------")
79 data.append(list(line))
80 print_debug(data)
81 print_debug("====================================")
82 self.data['tabledata'] = data
83
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Thu Oct 20 21:01:52 2016 | http://epydoc.sourceforge.net |