Excel Sorting

49 views
Skip to first unread message

Gregory Strydom

unread,
Sep 11, 2014, 9:29:21 AM9/11/14
to django...@googlegroups.com
Hey all.

I am just curious, is there any to do Excel style filtering in Django? Eg: Sort by date , category etc

The closest thing i have seen which resembles something like that is dictsort() or regroup(), but i have no idea how that would work for what i want. The only other option i could think of would be javascript, but again i dont know if that is needed if django does it naturally.

Thank you for any help with this!
Message has been deleted

Gregory Strydom

unread,
Sep 11, 2014, 9:33:49 AM9/11/14
to django...@googlegroups.com
Sorry i forgot to mention the filtering/sorting should be done in the view so the user can simply click on a button and sort by date, category etc

François Schiettecatte

unread,
Sep 11, 2014, 9:39:44 AM9/11/14
to django...@googlegroups.com
You have three ways you can do this:

- In the browser with Javascript, with all the data stored in the page (as a javascript array).

- In the browser with Javascript and a REST call to Django to get the data (in JSON for example).

- With a url that reloads the page with different parameters to sort/filter the data.

François

On Sep 11, 2014, at 9:33 AM, Gregory Strydom <gregory.s...@gmail.com> wrote:

> Sorry i forgot to mention the filtering/sorting should be done in the view so the user can simply click on a button and sort by date, category etc
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/af02ef85-eb9d-4537-93d0-da6a02ebd488%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

James Schneider

unread,
Sep 11, 2014, 12:46:21 PM9/11/14
to django...@googlegroups.com
Also check out django-tables2, which includes the sorting magic you are looking for. It uses the third option that François outlined below.


-James

Gregory Strydom

unread,
Sep 11, 2014, 1:58:59 PM9/11/14
to django...@googlegroups.com
Thanks very much for the help! Those look exactly like what im looking for :) I will start on them once im back at work tomorrow.
 

You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/BA7LsOHsVGw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.

For more options, visit https://groups.google.com/d/optout.



--
 - Best Wishes
   Gregory Strydom
Reply all
Reply to author
Forward
0 new messages