Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Internet > HTTP (WWW)

    django-sorting 0.1

    Download button

    No screenshots available
    Downloads: 350  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    directeur | More programs
    BSD License / FREE
    August 20th, 2009, 14:23 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    django-sorting description

    Like ericflo's django pagination, but this one does the sorting! used with ericflo's pagination, displaying tabular paginated and sortable data is very easy

    django-sorting is a project that allows for easy sorting, and tables headers () generation without modifying your views.

    How to use django-sorting:

    There are really 5 steps to setting it up with your projects.

    1. List this application in the ``INSTALLED_APPS`` portion of your settings file.  Your settings file might look something like::

           INSTALLED_APPS = (
               # ...
               'sorting',
           )


    2. Install the sorting middleware. Your settings file might look something like::

           MIDDLEWARE_CLASSES = (
               # ...
               'sorting.middleware.SortingMiddleware',
           )


    3. If it's not already added in your setup, add the request context processor. Note that context processors are set by default implicitly, so to set them explicitly, you need to copy and paste this code into your under the value TEMPLATE_CONTEXT_PROCESSORS::

            ("django.core.context_processors.auth",
            "django.core.context_processors.debug",
            "django.core.context_processors.i18n",
            "django.core.context_processors.media",
            "django.core.context_processors.request")


    4. Add this line at the top of your template to load the sorting tags:

           {% load sorting_tags %}

    5. Decide on a variable that you would like to sort, and use the autosort tag on that variable before iterating over it.

           {% autosort object_list %}

    6. Now, you want to display different headers with links to sort your objects_list:

           {% th first_name Name %}
           {% th creation_date Creation %}
            ...


    The first argument is a field of the objects list, and the second one(optional) is a title that would be displayed. The previous snippet will be rendered like this:

            Name
            Creation
            ...



    Product's homepage

    Requirements:

    · Python
    · Django

      


    TAGS:

    Django pagination | tables headers generation | Django sorting | Django | sorting | pagination

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM