django.views.generic.list

Here are the examples of the python api django.views.generic.list taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

Project: murano-dashboard Source File: views.py
def cleaned_latest_apps(request):
    """Returns a list of recently used apps

    Verifies, that apps in the list are either public or belong to current
    project.
    """
    id_param = "in:" + ",".join(request.session.get('latest_apps', []))
    query_params = {'type': 'Application', 'catalog': True, 'id': id_param}
    user_apps = list(api.muranoclient(request).packages.filter(**query_params))
    request.session['latest_apps'] = collections.deque([app.id
                                                        for app in user_apps])
    return user_apps

Example 2

Project: murano-dashboard Source File: views.py
    def get_queryset(self):
        query_params = self.get_query_params(internal_query=True)
        marker = self.request.GET.get('marker')

        sort_dir = query_params['sort_dir']

        packages = []
        with api.handled_exceptions(self.request):
            query_params['catalog'] = True
            packages, self._more = pkg_api.package_list(
                self.request, filters=query_params, paginate=True,
                marker=marker, page_size=self.paginate_by, sort_dir=sort_dir,
                limit=self.paginate_by)

        if sort_dir == 'desc':
            packages = list(reversed(packages))

        return packages