Beispiel #1
0
 def _get_query_view(self, url):
     """
     Return a query view object
     """
     from uliweb.form import IntField
     from uliweb.contrib.generic.forms import QueryForm
     
     id = IntField(label=_('ID'))
     fields = [('id', id),]
     layout = [('id',)]
     query = functions.QueryView(self.model, ok_url=url, fields=fields, layout=layout, form_cls=QueryForm)
     return query
Beispiel #2
0
    def _query_view(self, model, **kwargs):
        """
        :param model:
        :return: (query, condition)

        Default use QueryForm
        """
        QueryForm = functions.get_form('QueryForm')

        if 'form_cls' not in kwargs:
            kwargs['form_cls'] = QueryForm
        query = functions.QueryView(model, **kwargs)
        return query
Beispiel #3
0
    def _get_query_view(self, url):
        """
        Return a query view object
        """
        from uliweb.contrib.generic.forms import QueryForm

        Perm = functions.get_model('permission')

        fields = ['name', 'description']
        layout = [('name', 'description')]
        query = functions.QueryView(Perm,
                                    ok_url=url,
                                    fields=fields,
                                    layout=layout,
                                    form_cls=QueryForm)
        return query