Merge lp:~michael.nelson/ubuntu-webcatalog/777871-pull-other-apps-from-apt-cache-really into lp:ubuntu-webcatalog
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Michael Foord | ||||
Approved revision: | 29 | ||||
Merged at revision: | 23 | ||||
Proposed branch: | lp:~michael.nelson/ubuntu-webcatalog/777871-pull-other-apps-from-apt-cache-really | ||||
Merge into: | lp:ubuntu-webcatalog | ||||
Diff against target: |
400 lines (+170/-51) 5 files modified
django_project/config/main.cfg (+1/-0) src/webcatalog/forms.py (+21/-2) src/webcatalog/management/commands/import_app_install_data.py (+50/-25) src/webcatalog/tests/test_commands.py (+76/-21) src/webcatalog/tests/test_forms.py (+22/-3) |
||||
To merge this branch: | bzr merge lp:~michael.nelson/ubuntu-webcatalog/777871-pull-other-apps-from-apt-cache-really | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Foord (community) | Approve | ||
Ricardo Kirkner (community) | Approve | ||
Review via email: mp+65655@code.launchpad.net |
Commit message
Import apps from the apt-cache for the distroseries in addition to the app-install-data.
Description of the change
Overview
========
Imports and updates applications from the apt-cache before processing the desktop data in app-install-data. (bug 777871).
Details
=======
As well as providing the new update_from_cache method for use during import, this branch also ensures that when the desktop files are subsequently parsed, we don't overwrite values, like Application.
While there, I simplified the process_
Issues
======
As far as I can see, the only useful data I can grab from the apt-cache is: package name, description, section and summary. This leaves us with a few issues that we may either want to fix in this branch, or create bugs and fix soon:
1) Our templates assume that apps have a name (eg. we use Application.name when linking to package details), but for apps that are created from the cache only, I'm not sure what we should use (perhaps a template tag name_or_
2) We've got required fields, such as popcon on the Application model, which we don't get from the cache, so apps which are created from cache only won't have this (meaning records that can't be edited in the admin).
To test: follow the readme to bootstrap, then `fab test`
l. 113-129: this can be replaced by a call to get_or_create, avoiding the need of a try..except block