Package ajango :: Package generator :: Module menu_manager
[hide private]
[frames] | no frames]

Source Code for Module ajango.generator.menu_manager

 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 zarzadzajacy menu. 
21   
22  Pozwala na automatyczne stworzenie menu z uzytych w aplikacji widokach. 
23  Poszczegolne pozycje dostepne sa w menu pod warunkiem ze typ widoku nalezy 
24  do jednego z wybranych typow. 
25   
26      - L{empty<ajango.generator.views.empty>}. 
27      - L{list<ajango.generator.views.list>}. 
28      - L{editable<ajango.generator.views.editable>}. 
29      - L{input<ajango.generator.views.input>}. 
30      - L{container<ajango.generator.views.container>}. 
31  """ 
32   
33  from ajango.generator.renderer import DefRenderer 
34   
35 -def is_display_in_menu(view):
36 """ Sprawdza czy widok ma byc pokazywany w menu. """ 37 display_type = ['empty', 'list', 'input', 'container'] 38 for elem in display_type: 39 if view.type == elem: 40 return True 41 return view.is_display_in_menu()
42 70