Skip to main content

Easy lists for django views

Project description

# django-smart-lists

from smart_lists.mixins import SmartListMixin

class AccountListView(LoginRequiredMixin, SmartListMixin, ListView):
model = Account
paginate_by = 100
ordering_allowed_fields = ['company_name', 'code', 'created_date']
list_display = ['company_name', 'code', 'created_date', 'balance']

This will give you a click-to-sort table with pagination. All you have to do is to make a template like this:


{% extends "base.html" %}
{% load smart_list %}

{% block content %}
{% smart_list %}
{% endblock %}

**The built-in templates are bootstrap 3 compatible - but override them easily (by positioning the apps in INSTALLED_APPS) to fit your own needs**

# Other features

django-smart-lists supports commmon method attributes supported by django admin, such as:


class EpicModel(models.Model):
title = models.CharField(max_length=128)

def get_pretty_title(self):
return "Pretty {}".format(self.title)
get_pretty_title.short_description = 'Pretty Title'
get_pretty_title.admin_order_field = 'title'

### License

MIT License

Copyright (c) 2017 Plecto

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-smart-lists-1.0.18.tar.gz (10.6 kB) Copy SHA256 hash SHA256 Source None Oct 8, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page