# Copyright (C) 2019 by frePPLe bvba # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero # General Public License for more details. # # You should have received a copy of the GNU Affero General Public # License along with this program. If not, see <http://www.gnu.org/licenses/>. # from django.utils.translation import gettext_lazy as _ from freppledb.menu import menu from .views import ExecuteSQL menu.addGroup("custom", label=_("custom"), index=750) menu.addItem( "custom", "executesql", url="/executesql/", report=ExecuteSQL, label=_("Execute SQL"), index=1100, )
request.database).filter(Q(user=request.user) | Q(public=True)).order_by("name")): result.append(( index, x.name, MenuItem( x.name, url="/reportmanager/%s/" % x.id, label=x.name, index=index, prefix=request.prefix, ), )) index += 1 return result menu.addGroup("myreports", label=_("my reports"), index=750) menu.addItem("myreports", "myreports", callback=MyReports, index=100) menu.addItem("myreports", "data", separator=True, index=1000) menu.addItem( "myreports", "reportmanager", url="/data/reportmanager/sqlreport/", report=ReportList, permission="reportmanager.change_sqlreport", model=SQLReport, index=1100, admin=True, )
# Copyright (C) 2021 Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). """ This file is used to add customized entries to the menu. """ from django.utils.translation import ugettext as _ from freppledb.menu import menu from .models import My_Model from .views import MyModelList menu.addGroup("my_menu", label=_("My App"), index=1) menu.addItem( "my_menu", "my_model", url="/data/my_app/my_model/", report=MyModelList, index=100, model=My_Model, ) menu.addItem( "my_menu", "google", url="http://google.com", window=True, label=_("link to my company"), prefix=False, index=300, )