django: packages pages

Django migration: #47 (closed)

This MR re-adds models and pages related to packages.

This includes:

  • The frontpage listing of last month's packages
  • The packages listing under /packages
  • The search engine under /packages/:key/:value
  • The RSS feed under all previous pages under <URL>/feed
  • The pacakge detail page under /package/:name
  • Delete and needs_sponsor routes to take action on the package (/package/:name/delete and /package/:name/sponsor)
  • As usual, functional tests for those pages

It does not include the following:

  • The comment and subscription system
  • QA informations
  • Any logic for package importation

Those are meant to be implemented in the next packages MR.

This MR make the following display changes:

  • On packages listing:
    • show only the short description
    • version lists one version per distribution (distribution added in the field)
  • On package detail page:
    • Upload term replaces Version (expect when actually talking about a version number)
    • PTS link fixed
    • Package deletion and needs_sponsor toogle links are replaced by forms with button. (See below)

Those are propositions and are open to suggestions, removal to match the old behaviour, improvement, and so on...

Package deletion and needs_sponsor routes have been replaced by POST method. This new behavior has a double benefit:

  • Match the HTTP method sementic where GET is only used to gather information, not modify something.
  • Drop the in-url key to protect against CSRF attacks. This is automatically replaced by django csrf_token middleware (because of the POST method), allowing to simplify the code.

A word about the new database models:

  • Project, Distribution, Section, Priority and Architecture are now foreign keys. The rational behind this is to allow an easy and efficient parsing for searching packages. I would rather have a SELECT * FROM packages_architecture for criteria to present to the user than a SELECT DISINCT architecture FROM packages_binarypackage.
  • Others models have been tweaked to match more closely their definition in a Debian package in the policy.

Current testing env is up-to-date with this branch and have packages imported from live.

As always, @mattia, I'm looking forward to your comments. Thanks again!

Merge request reports

Loading