Skip to content
This repository has been archived by the owner on Sep 19, 2018. It is now read-only.

Reverse the order of events #412

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ioana-chiorean
Copy link
Collaborator

No description provided.

@mitio
Copy link
Member

mitio commented Sep 25, 2015

Thanks, @ioana-chiorean!

Have you tested this in your local copy? The tests are failing.

I will have a look at it tomorrow.

@RadoRado
Copy link

I think .reverse() is an invalid call which makes the paginate tag invalid.

It is a better idea to reverse the list when looping it:

 {% for obj in list reversed %}

This will make the following change:

{% for event in country_events reversed %}

@RadoRado
Copy link

By the way, my previous comment is not logically correct. This will reverse only the first page of events, which will lead to strange results.

There are two things that can be done:

  1. Try to call reverse without the brackets (). In Django, you can call methods from the template language as long as they don't have arguments
  2. If there are arguments - https://docs.djangoproject.com/en/dev/howto/custom-template-tags/
  3. The list can be reversed in the events view, but with a quick check - there is a lot of code duplication to be cleaned first.

Cheers!

@mitio
Copy link
Member

mitio commented Sep 29, 2015

@ioana-chiorean Are you able to try the alternatives @RadoRado offered?

If you don't have the time, let us know.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants