Пример #1
0
    def _add_form_options(self, form_config):
        """
        add form options to the current configuration
        """
        options = self._get_type_options()

        options['categories'] = [
            {
                'value': '1',
                "label": u"Frais",
                'description': u"Frais liés au fonctionnement de l'entreprise"
            },
            {
                'value': '2',
                "label": u"Achats",
                'description': u"Frais concernant directement votre activité \
    auprès de vos clients"
            }]

        options['bookmarks'] = get_bookmarks(self.request)

        options['expenses'] = self._get_existing_expenses_options()

        expense_sheet = self.request.context
        month = expense_sheet.month
        year = expense_sheet.year

        date = datetime.date(year, month, 1)
        options['today'] = date

        options['edit'] = bool(self.request.has_permission('edit.expensesheet'))
        form_config['options'] = options
        return form_config
Пример #2
0
    def _add_form_options(self, form_config):
        """
        add form options to the current configuration
        """
        options = self._get_type_options()

        options['categories'] = [{
            'value':
            '1',
            "label":
            u"Frais",
            'description':
            u"Frais liés au fonctionnement de l'entreprise"
        }, {
            'value':
            '2',
            "label":
            u"Achats",
            'description':
            u"Frais concernant directement votre activité \
    auprès de vos clients"
        }]

        options['bookmarks'] = get_bookmarks(self.request)

        options['expenses'] = self._get_existing_expenses_options()

        expense_sheet = self.request.context
        month = expense_sheet.month
        year = expense_sheet.year

        date = datetime.date(year, month, 1)
        options['today'] = date

        options['edit'] = bool(
            self.request.has_permission('edit.expensesheet'))
        form_config['options'] = options
        return form_config
Пример #3
0
 def get(self):
     """
         Rest GET Method : get
     """
     return get_bookmarks(self.request)
Пример #4
0
 def get(self):
     """
         Rest GET Method : get
     """
     return get_bookmarks(self.request)