| 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 wyswietlania raportu.
21
22 Obiekt obsluguje strone wyswietlajaca raport na podstawie wybranych danych.
23
24 Obiekt Generujacy
25 =================
26
27 L{ajango.generator.views.raport}
28 """
29
30 from django.core.management.base import CommandError
31 from ajango.site.sites import GetSite
32 from ajango.site.sites.list import Site as List
33 from ajango.database.columns.button import Column as Button
34
36 """ Klasa wyswietlania raportu. """
45 """ Ustawienie pliku z szablonem dla raportu. """
46 if is_build:
47 template = "ajango_raports/ajango_%s.html" % template
48 self.set_include(template)
53 """ Buduje dane dla strony. """
54 self.data['tabledata'] = []
55 elem_id = self.get_id()
56 if elem_id >= 0:
57 results = self.query.get_by_filter({'id' : elem_id})
58 else:
59 results = self.query.get_all()
60 if len(results) < 1:
61 self.data['result'] = False
62 else:
63 data = []
64 for elem in results:
65 line = []
66 for col in self.column:
67 if isinstance(col, Button):
68 raise CommandError("Display view cannot "
69 "have Button column")
70 else:
71 line.append(col.get_data({'result' : elem}))
72 data.append(list(line))
73 self.data['tabledata'] = data
74 self.data['list_mode'] = self.list_mode
75
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Thu Oct 20 21:01:52 2016 | http://epydoc.sourceforge.net |