Port to Python 3 whilst continuing support for 2.7

Issue #404 new
Ed McDonagh created an issue

It's time! There are possibilities of using new modules that are python 3 only.

Current status of dependencies from https://caniusepython3.com/project/OpenREM:

  • django-pagination (which is blocking openrem) - can be replaced by the inbuilt django pagination
  • django-qsstats-magic (which is blocking openrem) - not sure what to do with this one - has open issue regarding python 3 which is quite old...
  • django-solo (which is blocking openrem) - can't find anything immediately regarding python 3 intentions or issues.

Using:

Comments (42)

  1. Ed McDonagh reporter

    Extractor files have remapp/Django setup stuff at top, doesn't need to be duplicated, doesn't need to import file that was upsetting futurize. Refs #404

    → <<cset 1a4b694e72ad>>

  2. Ed McDonagh reporter

    Disabling pylint warnings regarding overriding builtins due to future. Refs #404 Should be possible with a single config line in pylint, but I'm not sure how to do it in Codacy!

    → <<cset 827ba5240239>>

  3. Ed McDonagh reporter

    @David Platten @Luuk - can you take a quick look at http://testing.openrem.org/openrem/ct/ please?

    I've replaced the django-pagination function with the in-built Django pagination function, plus some styling from a gist I came across.

    What do you think? We need to stop using django-pagination to move onto newer versions of Django and Python. And it isn't required anymore anyway!

    Also, David, the charts on that page are blank for me - am I doing something wrong?

  4. Ed McDonagh reporter

    I think I'll probably reduce the number of 'neighbours' down from the current 10 to about 5.

  5. Ed McDonagh reporter

    @David Platten - Both displaynameview.html and rfalertnotificationsview.html have {% paginate %} tags in them, but they don't have the {% autopaginate object_list %} tags in them, so I don't think the pagination has ever functioned. I can't see how it would function for the display names page!

    Question - do I just remove the tags (I think functionality stays as is), or do I fix them up, or maybe just the RF Alert Notifications page so that they paginate using the new method?

  6. Ed McDonagh reporter

    Added paginate to filteredbase template, removed old paginate from templates, added to views for dx, rf, mg. Reformatted filteredbase template.. Refs #404

    → <<cset 48840a72ac1e>>

  7. Ed McDonagh reporter

    Broke the home page as AnonymousUser has no user profile attribute. Elsewhere the user will be logged in, so should be ok... I think! Refs #404

    → <<cset c50ace87ed72>>

  8. David Platten

    @Ed McDonagh, I've been looking at the same thing (in the PHE CT export branch). I have fixed the problem by changing a couple of lines of code in the charting functions. I'm not sure what has caused the break.

  9. Log in to comment