Merge lp:~lukasz-czyzykowski/ubuntu-webcatalog/upgrade-to-django-1.5 into lp:ubuntu-webcatalog
- upgrade-to-django-1.5
- Merge into trunk
Proposed by
Łukasz Czyżykowski
Status: | Merged |
---|---|
Approved by: | Łukasz Czyżykowski |
Approved revision: | 199 |
Merged at revision: | 179 |
Proposed branch: | lp:~lukasz-czyzykowski/ubuntu-webcatalog/upgrade-to-django-1.5 |
Merge into: | lp:ubuntu-webcatalog |
Diff against target: |
743 lines (+96/-76) 34 files modified
django_project/config/main.cfg (+4/-5) django_project/urls.py (+4/-3) fabtasks/django.py (+3/-9) setup.py (+3/-2) src/webcatalog/api/__init__.py (+14/-0) src/webcatalog/api/handlers.py (+7/-0) src/webcatalog/auth.py (+3/-1) src/webcatalog/management/commands/cleanup.py (+3/-0) src/webcatalog/management/commands/import_ratings_stats.py (+4/-2) src/webcatalog/migrations/0015_add_applicationmedia.py (+2/-2) src/webcatalog/migrations/0016_populate_application_media.py (+1/-1) src/webcatalog/models/applications.py (+2/-2) src/webcatalog/schema.py (+1/-3) src/webcatalog/templates/404.html (+1/-1) src/webcatalog/templates/light/index.1col.html (+1/-1) src/webcatalog/templates/webcatalog/app_carousel_widget.html (+2/-2) src/webcatalog/templates/webcatalog/application_detail.html (+7/-7) src/webcatalog/templates/webcatalog/application_list_snippet.html (+2/-2) src/webcatalog/templates/webcatalog/base.html (+3/-3) src/webcatalog/templates/webcatalog/department_overview.html (+1/-1) src/webcatalog/templates/webcatalog/department_overview_snippet.html (+1/-1) src/webcatalog/templates/webcatalog/exhibits_widget.html (+1/-1) src/webcatalog/templates/webcatalog/featured_apps_widget.html (+1/-1) src/webcatalog/templates/webcatalog/index.html (+3/-3) src/webcatalog/templates/webcatalog/recommended_apps_widget.html (+1/-1) src/webcatalog/templates/webcatalog/search_results.html (+1/-1) src/webcatalog/templates/webcatalog/task_list.html (+2/-2) src/webcatalog/templates/webcatalog/top_rated_apps_widget.html (+1/-1) src/webcatalog/tests/factory.py (+3/-1) src/webcatalog/tests/test_commands.py (+10/-8) src/webcatalog/tests/test_preflight.py (+1/-1) src/webcatalog/tests/test_views.py (+1/-1) src/webcatalog/views.py (+2/-2) test_requirements.txt (+0/-5) |
To merge this branch: | bzr merge lp:~lukasz-czyzykowski/ubuntu-webcatalog/upgrade-to-django-1.5 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Nelson (community) | Approve | ||
Review via email: mp+158009@code.launchpad.net |
Commit message
Upgrade to Django 1.5.1
Description of the change
Upgrade to Django 1.5.1
To post a comment you must log in.
- 199. By Łukasz Czyżykowski
-
Added comment about _is_string attribute on http responses in the api module.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'django_project/config/main.cfg' | |||
2 | --- django_project/config/main.cfg 2013-02-28 16:23:58 +0000 | |||
3 | +++ django_project/config/main.cfg 2013-04-15 13:23:28 +0000 | |||
4 | @@ -37,6 +37,9 @@ | |||
5 | 37 | webcatalog.middleware.exception.LogExceptionMiddleware | 37 | webcatalog.middleware.exception.LogExceptionMiddleware |
6 | 38 | django.middleware.cache.FetchFromCacheMiddleware | 38 | django.middleware.cache.FetchFromCacheMiddleware |
7 | 39 | fixture_dirs = | 39 | fixture_dirs = |
8 | 40 | template_loaders = django.template.loaders.filesystem.Loader | ||
9 | 41 | django.template.loaders.app_directories.Loader | ||
10 | 42 | django.template.loaders.eggs.Loader | ||
11 | 40 | 43 | ||
12 | 41 | secret_key = eepu9Av5ixage9ahhodovahfaiFoorodahf6keip3eichaeW9f | 44 | secret_key = eepu9Av5ixage9ahhodovahfaiFoorodahf6keip3eichaeW9f |
13 | 42 | template_debug = %(debug)s | 45 | template_debug = %(debug)s |
14 | @@ -58,15 +61,11 @@ | |||
15 | 58 | admin_media_prefix = /assets/admin/ | 61 | admin_media_prefix = /assets/admin/ |
16 | 59 | test_runner = djcelery.contrib.test_runner.CeleryTestSuiteRunner | 62 | test_runner = djcelery.contrib.test_runner.CeleryTestSuiteRunner |
17 | 60 | 63 | ||
18 | 61 | # Django-1.1 backwards compatibility | ||
19 | 62 | database_engine = sqlite3 | ||
20 | 63 | database_name = webcatalog.db | ||
21 | 64 | |||
22 | 65 | [django_databases] | 64 | [django_databases] |
23 | 66 | default = default_database | 65 | default = default_database |
24 | 67 | 66 | ||
25 | 68 | [default_database] | 67 | [default_database] |
27 | 69 | engine = sqlite3 | 68 | engine = django.db.backends.sqlite3 |
28 | 70 | name = webcatalog.db | 69 | name = webcatalog.db |
29 | 71 | 70 | ||
30 | 72 | [django_logging] | 71 | [django_logging] |
31 | 73 | 72 | ||
32 | === modified file 'django_project/urls.py' | |||
33 | --- django_project/urls.py 2013-02-28 16:23:58 +0000 | |||
34 | +++ django_project/urls.py 2013-04-15 13:23:28 +0000 | |||
35 | @@ -16,11 +16,12 @@ | |||
36 | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
37 | 17 | 17 | ||
38 | 18 | import preflight | 18 | import preflight |
40 | 19 | from django.conf.urls.defaults import patterns, include, url | 19 | |
41 | 20 | from django.conf.urls import patterns, include, url | ||
42 | 20 | from django.conf import settings | 21 | from django.conf import settings |
43 | 21 | from django.contrib import admin | 22 | from django.contrib import admin |
44 | 22 | from django.contrib.auth.views import logout | 23 | from django.contrib.auth.views import logout |
46 | 23 | from django.views.generic.simple import redirect_to | 24 | from django.views.generic import RedirectView |
47 | 24 | 25 | ||
48 | 25 | admin.autodiscover() | 26 | admin.autodiscover() |
49 | 26 | preflight.autodiscover() | 27 | preflight.autodiscover() |
50 | @@ -33,7 +34,7 @@ | |||
51 | 33 | url(r'^cat/', include('webcatalog.urls')), | 34 | url(r'^cat/', include('webcatalog.urls')), |
52 | 34 | url(r'^admin/', include(admin.site.urls)), | 35 | url(r'^admin/', include(admin.site.urls)), |
53 | 35 | (r'^preflight/$', include('preflight.urls')), | 36 | (r'^preflight/$', include('preflight.urls')), |
55 | 36 | url(r'^$', redirect_to, {'url': '/cat/'}), | 37 | url(r'^$', RedirectView.as_view(url='/cat/')), |
56 | 37 | 38 | ||
57 | 38 | # OpenID views | 39 | # OpenID views |
58 | 39 | (r'^openid/', include('django_openid_auth.urls')), | 40 | (r'^openid/', include('django_openid_auth.urls')), |
59 | 40 | 41 | ||
60 | === modified file 'fabtasks/django.py' | |||
61 | --- fabtasks/django.py 2011-09-12 13:37:24 +0000 | |||
62 | +++ fabtasks/django.py 2013-04-15 13:23:28 +0000 | |||
63 | @@ -23,6 +23,7 @@ | |||
64 | 23 | from ConfigParser import ConfigParser | 23 | from ConfigParser import ConfigParser |
65 | 24 | from xml.etree import ElementTree as et | 24 | from xml.etree import ElementTree as et |
66 | 25 | 25 | ||
67 | 26 | |||
68 | 26 | def manage(command, *args): | 27 | def manage(command, *args): |
69 | 27 | """Run manage.py command""" | 28 | """Run manage.py command""" |
70 | 28 | local("virtualenv/bin/python django_project/manage.py {0} {1}".format( | 29 | local("virtualenv/bin/python django_project/manage.py {0} {1}".format( |
71 | @@ -34,15 +35,10 @@ | |||
72 | 34 | spec = "webcatalog" | 35 | spec = "webcatalog" |
73 | 35 | if pg: | 36 | if pg: |
74 | 36 | local("virtualenv/bin/pip install psycopg2==2.4.1") | 37 | local("virtualenv/bin/pip install psycopg2==2.4.1") |
75 | 37 | conf = { | ||
76 | 38 | 'database_name': "uwc", | ||
77 | 39 | 'database_engine': "postgresql_psycopg2", | ||
78 | 40 | 'database_user': "postgres", | ||
79 | 41 | } | ||
80 | 42 | conf_db = { | 38 | conf_db = { |
82 | 43 | 'engine': "postgresql_psycopg2", | 39 | 'engine': "django.db.backends.postgresql_psycopg2", |
83 | 44 | 'name': "uwc", | 40 | 'name': "uwc", |
85 | 45 | 'database_user': "postgres" | 41 | 'user': "postgres" |
86 | 46 | } | 42 | } |
87 | 47 | conf_file = "django_project/local.cfg" | 43 | conf_file = "django_project/local.cfg" |
88 | 48 | parser = ConfigParser() | 44 | parser = ConfigParser() |
89 | @@ -51,8 +47,6 @@ | |||
90 | 51 | parser.read([conf_file]) | 47 | parser.read([conf_file]) |
91 | 52 | if not parser.has_section('django'): | 48 | if not parser.has_section('django'): |
92 | 53 | parser.add_section('django') | 49 | parser.add_section('django') |
93 | 54 | for name, value in conf.items(): | ||
94 | 55 | parser.set('django', name, value) | ||
95 | 56 | if not parser.has_section('default_database'): | 50 | if not parser.has_section('default_database'): |
96 | 57 | parser.add_section('default_database') | 51 | parser.add_section('default_database') |
97 | 58 | for name, value in conf_db.items(): | 52 | for name, value in conf_db.items(): |
98 | 59 | 53 | ||
99 | === modified file 'setup.py' | |||
100 | --- setup.py 2013-02-28 16:23:58 +0000 | |||
101 | +++ setup.py 2013-04-15 13:23:28 +0000 | |||
102 | @@ -1,6 +1,7 @@ | |||
103 | 1 | import os | 1 | import os |
104 | 2 | from setuptools import setup, find_packages | 2 | from setuptools import setup, find_packages |
105 | 3 | 3 | ||
106 | 4 | |||
107 | 4 | def find_packages_data(start_dir): | 5 | def find_packages_data(start_dir): |
108 | 5 | packages = {} | 6 | packages = {} |
109 | 6 | for package_name in os.listdir(start_dir): | 7 | for package_name in os.listdir(start_dir): |
110 | @@ -35,9 +36,9 @@ | |||
111 | 35 | install_requires = [ | 36 | install_requires = [ |
112 | 36 | 'django', | 37 | 'django', |
113 | 37 | 'setuptools', | 38 | 'setuptools', |
115 | 38 | 'south==0.7.3', | 39 | 'south==0.7.6', |
116 | 39 | 'configglue==1.0.1', | 40 | 'configglue==1.0.1', |
118 | 40 | 'django-configglue==0.6.1', | 41 | 'django-configglue==0.7', |
119 | 41 | 'django-openid-auth==0.2', | 42 | 'django-openid-auth==0.2', |
120 | 42 | 'django-piston==0.2.3', | 43 | 'django-piston==0.2.3', |
121 | 43 | 'django-preflight', | 44 | 'django-preflight', |
122 | 44 | 45 | ||
123 | === modified file 'src/webcatalog/api/__init__.py' | |||
124 | --- src/webcatalog/api/__init__.py 2011-09-12 13:37:24 +0000 | |||
125 | +++ src/webcatalog/api/__init__.py 2013-04-15 13:23:28 +0000 | |||
126 | @@ -13,3 +13,17 @@ | |||
127 | 13 | # | 13 | # |
128 | 14 | # You should have received a copy of the GNU Affero General Public License | 14 | # You should have received a copy of the GNU Affero General Public License |
129 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
130 | 16 | |||
131 | 17 | # Bit of surgery on pison internals, this fixes | ||
132 | 18 | # https://github.com/simplejson/simplejson/issues/37 | ||
133 | 19 | |||
134 | 20 | import json | ||
135 | 21 | import simplejson | ||
136 | 22 | |||
137 | 23 | from piston.utils import Mimer | ||
138 | 24 | from piston import emitters | ||
139 | 25 | |||
140 | 26 | emitters.simplejson = json | ||
141 | 27 | |||
142 | 28 | Mimer.unregister(simplejson.loads) | ||
143 | 29 | Mimer.register(json.loads, ('application/json',)) | ||
144 | 16 | 30 | ||
145 | === modified file 'src/webcatalog/api/handlers.py' | |||
146 | --- src/webcatalog/api/handlers.py 2012-09-17 15:55:15 +0000 | |||
147 | +++ src/webcatalog/api/handlers.py 2013-04-15 13:23:28 +0000 | |||
148 | @@ -41,6 +41,13 @@ | |||
149 | 41 | ) | 41 | ) |
150 | 42 | from .forms import MachineCreateUpdateForm, MachineUpdatePackagesForm | 42 | from .forms import MachineCreateUpdateForm, MachineUpdatePackagesForm |
151 | 43 | 43 | ||
152 | 44 | # django-piston (outdated bit of software) expects those attributes to | ||
153 | 45 | # determine if the resonse content is iterator or not. Here we never | ||
154 | 46 | # use that possibliblit, so hardcoding the attribute. | ||
155 | 47 | HttpResponse._is_string = True | ||
156 | 48 | HttpResponseNotFound._is_string = True | ||
157 | 49 | HttpResponseBadRequest._is_string = True | ||
158 | 50 | |||
159 | 44 | 51 | ||
160 | 45 | class ServerStatusHandler(BaseHandler): | 52 | class ServerStatusHandler(BaseHandler): |
161 | 46 | allowed_methods = ('GET',) | 53 | allowed_methods = ('GET',) |
162 | 47 | 54 | ||
163 | === modified file 'src/webcatalog/auth.py' | |||
164 | --- src/webcatalog/auth.py 2012-06-30 00:09:12 +0000 | |||
165 | +++ src/webcatalog/auth.py 2013-04-15 13:23:28 +0000 | |||
166 | @@ -24,6 +24,7 @@ | |||
167 | 24 | __all__ = [ | 24 | __all__ = [ |
168 | 25 | 'SSOOAuthAuthentication', | 25 | 'SSOOAuthAuthentication', |
169 | 26 | ] | 26 | ] |
170 | 27 | import pytz | ||
171 | 27 | 28 | ||
172 | 28 | from datetime import datetime, timedelta | 29 | from datetime import datetime, timedelta |
173 | 29 | from django.conf import settings | 30 | from django.conf import settings |
174 | @@ -100,7 +101,8 @@ | |||
175 | 100 | tokens = Token.objects.filter(token=oauthtoken, | 101 | tokens = Token.objects.filter(token=oauthtoken, |
176 | 101 | consumer__key=consumer_key) | 102 | consumer__key=consumer_key) |
177 | 102 | if (len(tokens) == 0 or | 103 | if (len(tokens) == 0 or |
179 | 103 | tokens[0].updated_at < datetime.now() - TOKEN_CACHE_EXPIRY): | 104 | tokens[0].updated_at < ( |
180 | 105 | datetime.now(pytz.utc) - TOKEN_CACHE_EXPIRY)): | ||
181 | 104 | pieces = web_services.get_data_for_account( | 106 | pieces = web_services.get_data_for_account( |
182 | 105 | token=oauthtoken, openid_identifier=consumer_key, | 107 | token=oauthtoken, openid_identifier=consumer_key, |
183 | 106 | signature=request.get_parameter('oauth_signature')) | 108 | signature=request.get_parameter('oauth_signature')) |
184 | 107 | 109 | ||
185 | === modified file 'src/webcatalog/management/commands/cleanup.py' | |||
186 | --- src/webcatalog/management/commands/cleanup.py 2012-09-11 14:19:39 +0000 | |||
187 | +++ src/webcatalog/management/commands/cleanup.py 2013-04-15 13:23:28 +0000 | |||
188 | @@ -27,6 +27,7 @@ | |||
189 | 27 | 27 | ||
190 | 28 | try: | 28 | try: |
191 | 29 | import psycopg2 | 29 | import psycopg2 |
192 | 30 | psycopg2 | ||
193 | 30 | psycopg2_available = True | 31 | psycopg2_available = True |
194 | 31 | except ImportError: | 32 | except ImportError: |
195 | 32 | psycopg2_available = False | 33 | psycopg2_available = False |
196 | @@ -165,6 +166,8 @@ | |||
197 | 165 | batch_size -= batch_size_wobble | 166 | batch_size -= batch_size_wobble |
198 | 166 | elif actual_batch_time < target_batch_time * 0.9: | 167 | elif actual_batch_time < target_batch_time * 0.9: |
199 | 167 | batch_size += batch_size_wobble | 168 | batch_size += batch_size_wobble |
200 | 169 | if batch_size < 1: | ||
201 | 170 | batch_size = 1 | ||
202 | 168 | 171 | ||
203 | 169 | def output(self, message, level=None, flush=False): | 172 | def output(self, message, level=None, flush=False): |
204 | 170 | if hasattr(self, 'stdout'): | 173 | if hasattr(self, 'stdout'): |
205 | 171 | 174 | ||
206 | === modified file 'src/webcatalog/management/commands/import_ratings_stats.py' | |||
207 | --- src/webcatalog/management/commands/import_ratings_stats.py 2012-12-03 16:25:55 +0000 | |||
208 | +++ src/webcatalog/management/commands/import_ratings_stats.py 2013-04-15 13:23:28 +0000 | |||
209 | @@ -18,6 +18,8 @@ | |||
210 | 18 | """Management command to import review statistics for a distroseries.""" | 18 | """Management command to import review statistics for a distroseries.""" |
211 | 19 | 19 | ||
212 | 20 | import json | 20 | import json |
213 | 21 | import pytz | ||
214 | 22 | |||
215 | 21 | from datetime import ( | 23 | from datetime import ( |
216 | 22 | datetime, | 24 | datetime, |
217 | 23 | timedelta, | 25 | timedelta, |
218 | @@ -87,7 +89,7 @@ | |||
219 | 87 | def update_last_import_timestamp(self, distroseries): | 89 | def update_last_import_timestamp(self, distroseries): |
220 | 88 | review_stats_import, created = ReviewStatsImport.objects.get_or_create( | 90 | review_stats_import, created = ReviewStatsImport.objects.get_or_create( |
221 | 89 | distroseries=distroseries) | 91 | distroseries=distroseries) |
223 | 90 | review_stats_import.last_import = datetime.utcnow() | 92 | review_stats_import.last_import = datetime.now(pytz.utc) |
224 | 91 | review_stats_import.save() | 93 | review_stats_import.save() |
225 | 92 | 94 | ||
226 | 93 | def download_review_stats(self, distroseries): | 95 | def download_review_stats(self, distroseries): |
227 | @@ -99,7 +101,7 @@ | |||
228 | 99 | if other_imports: | 101 | if other_imports: |
229 | 100 | stats_import = other_imports[0] | 102 | stats_import = other_imports[0] |
230 | 101 | time_since_last_import = ( | 103 | time_since_last_import = ( |
232 | 102 | datetime.utcnow() - stats_import.last_import) | 104 | datetime.now(pytz.utc) - stats_import.last_import) |
233 | 103 | if time_since_last_import < timedelta(days=1): | 105 | if time_since_last_import < timedelta(days=1): |
234 | 104 | num_days = 1 | 106 | num_days = 1 |
235 | 105 | elif time_since_last_import < timedelta(days=3): | 107 | elif time_since_last_import < timedelta(days=3): |
236 | 106 | 108 | ||
237 | === modified file 'src/webcatalog/migrations/0015_add_applicationmedia.py' | |||
238 | --- src/webcatalog/migrations/0015_add_applicationmedia.py 2012-03-19 08:18:57 +0000 | |||
239 | +++ src/webcatalog/migrations/0015_add_applicationmedia.py 2013-04-15 13:23:28 +0000 | |||
240 | @@ -16,7 +16,7 @@ | |||
241 | 16 | self.gf('django.db.models.fields.CharField')(max_length=16)), | 16 | self.gf('django.db.models.fields.CharField')(max_length=16)), |
242 | 17 | ('url', | 17 | ('url', |
243 | 18 | self.gf('django.db.models.fields.URLField')( | 18 | self.gf('django.db.models.fields.URLField')( |
245 | 19 | max_length=200, verify_exists=False)), | 19 | max_length=200)), |
246 | 20 | )) | 20 | )) |
247 | 21 | db.send_create_signal('webcatalog', ['ApplicationMedia']) | 21 | db.send_create_signal('webcatalog', ['ApplicationMedia']) |
248 | 22 | 22 | ||
249 | @@ -66,7 +66,7 @@ | |||
250 | 66 | 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | 66 | 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
251 | 67 | 'media_type': ('django.db.models.fields.CharField', [], {'max_length': '16'}), | 67 | 'media_type': ('django.db.models.fields.CharField', [], {'max_length': '16'}), |
252 | 68 | 'url': ('django.db.models.fields.URLField', [], | 68 | 'url': ('django.db.models.fields.URLField', [], |
254 | 69 | {'max_length': '200', 'verify_exists': 'False'}) | 69 | {'max_length': '200'}) |
255 | 70 | }, | 70 | }, |
256 | 71 | 'webcatalog.application': { | 71 | 'webcatalog.application': { |
257 | 72 | 'Meta': {'unique_together': "(('distroseries', 'archive_id'),)", 'object_name': 'Application'}, | 72 | 'Meta': {'unique_together': "(('distroseries', 'archive_id'),)", 'object_name': 'Application'}, |
258 | 73 | 73 | ||
259 | === modified file 'src/webcatalog/migrations/0016_populate_application_media.py' | |||
260 | --- src/webcatalog/migrations/0016_populate_application_media.py 2012-03-19 08:18:57 +0000 | |||
261 | +++ src/webcatalog/migrations/0016_populate_application_media.py 2013-04-15 13:23:28 +0000 | |||
262 | @@ -94,7 +94,7 @@ | |||
263 | 94 | 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | 94 | 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
264 | 95 | 'media_type': ('django.db.models.fields.CharField', [], {'max_length': '16'}), | 95 | 'media_type': ('django.db.models.fields.CharField', [], {'max_length': '16'}), |
265 | 96 | 'url': ('django.db.models.fields.URLField', [], | 96 | 'url': ('django.db.models.fields.URLField', [], |
267 | 97 | {'max_length': '200', 'verify_exists': 'False'}) | 97 | {'max_length': '200'}) |
268 | 98 | }, | 98 | }, |
269 | 99 | 'webcatalog.consumer': { | 99 | 'webcatalog.consumer': { |
270 | 100 | 'Meta': {'object_name': 'Consumer'}, | 100 | 'Meta': {'object_name': 'Consumer'}, |
271 | 101 | 101 | ||
272 | === modified file 'src/webcatalog/models/applications.py' | |||
273 | --- src/webcatalog/models/applications.py 2012-09-06 14:07:55 +0000 | |||
274 | +++ src/webcatalog/models/applications.py 2013-04-15 13:23:28 +0000 | |||
275 | @@ -226,7 +226,7 @@ | |||
276 | 226 | 226 | ||
277 | 227 | application = models.ForeignKey(Application) | 227 | application = models.ForeignKey(Application) |
278 | 228 | media_type = models.CharField(max_length=16, choices=MEDIA_CHOICES) | 228 | media_type = models.CharField(max_length=16, choices=MEDIA_CHOICES) |
280 | 229 | url = models.URLField(verify_exists=False) | 229 | url = models.URLField() |
281 | 230 | 230 | ||
282 | 231 | def __unicode__(self): | 231 | def __unicode__(self): |
283 | 232 | return "{0} for {1}".format(self.media_type, self.application) | 232 | return "{0} for {1}".format(self.media_type, self.application) |
284 | @@ -286,7 +286,7 @@ | |||
285 | 286 | sca_id = models.IntegerField() | 286 | sca_id = models.IntegerField() |
286 | 287 | package_names = models.CharField(max_length=1024) | 287 | package_names = models.CharField(max_length=1024) |
287 | 288 | banner_url = models.CharField(max_length=1024) | 288 | banner_url = models.CharField(max_length=1024) |
289 | 289 | click_url = models.URLField(verify_exists=False, default='') | 289 | click_url = models.URLField(default='') |
290 | 290 | distroseries = models.ManyToManyField(DistroSeries) | 290 | distroseries = models.ManyToManyField(DistroSeries) |
291 | 291 | html = models.TextField() | 291 | html = models.TextField() |
292 | 292 | date_created = models.DateTimeField(auto_now_add=True) | 292 | date_created = models.DateTimeField(auto_now_add=True) |
293 | 293 | 293 | ||
294 | === modified file 'src/webcatalog/schema.py' | |||
295 | --- src/webcatalog/schema.py 2013-02-28 16:23:58 +0000 | |||
296 | +++ src/webcatalog/schema.py 2013-04-15 13:23:28 +0000 | |||
297 | @@ -17,13 +17,11 @@ | |||
298 | 17 | 17 | ||
299 | 18 | """configglue schema for the Apps Directory.""" | 18 | """configglue schema for the Apps Directory.""" |
300 | 19 | 19 | ||
301 | 20 | |||
302 | 21 | import django | ||
303 | 22 | from configglue import schema | 20 | from configglue import schema |
304 | 23 | from django_configglue.schema import schemas | 21 | from django_configglue.schema import schemas |
305 | 24 | from oops_dictconfig.configglue_options import OopsOption | 22 | from oops_dictconfig.configglue_options import OopsOption |
306 | 25 | 23 | ||
308 | 26 | DjangoSchema = schemas.get('1.3.1') | 24 | DjangoSchema = schemas.get('1.5.1') |
309 | 27 | 25 | ||
310 | 28 | 26 | ||
311 | 29 | class WebCatalogSchema(DjangoSchema): | 27 | class WebCatalogSchema(DjangoSchema): |
312 | 30 | 28 | ||
313 | === modified file 'src/webcatalog/templates/404.html' | |||
314 | --- src/webcatalog/templates/404.html 2012-03-19 15:17:36 +0000 | |||
315 | +++ src/webcatalog/templates/404.html 2013-04-15 13:23:28 +0000 | |||
316 | @@ -11,7 +11,7 @@ | |||
317 | 11 | {% block header %}{% endblock %} | 11 | {% block header %}{% endblock %} |
318 | 12 | 12 | ||
319 | 13 | {% block head_extra %} | 13 | {% block head_extra %} |
321 | 14 | <link rel="stylesheet" type="text/css" href="{% url wc-combo %}?light/css/reset.css&light/css/styles.css&light/css/404.css&light/css/forms.css"/> | 14 | <link rel="stylesheet" type="text/css" href="{% url 'wc-combo' %}?light/css/reset.css&light/css/styles.css&light/css/404.css&light/css/forms.css"/> |
322 | 15 | {% endblock %} | 15 | {% endblock %} |
323 | 16 | 16 | ||
324 | 17 | {% block content_container %} | 17 | {% block content_container %} |
325 | 18 | 18 | ||
326 | === modified file 'src/webcatalog/templates/light/index.1col.html' | |||
327 | --- src/webcatalog/templates/light/index.1col.html 2012-06-09 02:15:00 +0000 | |||
328 | +++ src/webcatalog/templates/light/index.1col.html 2013-04-15 13:23:28 +0000 | |||
329 | @@ -6,7 +6,7 @@ | |||
330 | 6 | <link rel="shortcut icon" href="{{ STATIC_URL }}images/favicon.ico" type="image/x-icon" /> | 6 | <link rel="shortcut icon" href="{{ STATIC_URL }}images/favicon.ico" type="image/x-icon" /> |
331 | 7 | <link rel="stylesheet" type="text/css" media="all" href="https://fonts.googleapis.com/css?family=Ubuntu:300,300italic,400,400italic" /> | 7 | <link rel="stylesheet" type="text/css" media="all" href="https://fonts.googleapis.com/css?family=Ubuntu:300,300italic,400,400italic" /> |
332 | 8 | {% block head_extra %} | 8 | {% block head_extra %} |
334 | 9 | <link rel="stylesheet" type="text/css" href="{% url wc-combo %}?light/css/reset.css&light/css/styles.css&light/css/forms.css"/> | 9 | <link rel="stylesheet" type="text/css" href="{% url 'wc-combo' %}?light/css/reset.css&light/css/styles.css&light/css/forms.css"/> |
335 | 10 | {% endblock %} | 10 | {% endblock %} |
336 | 11 | </head> | 11 | </head> |
337 | 12 | <body {% block body_extra %}{% endblock %}> | 12 | <body {% block body_extra %}{% endblock %}> |
338 | 13 | 13 | ||
339 | === modified file 'src/webcatalog/templates/webcatalog/app_carousel_widget.html' | |||
340 | --- src/webcatalog/templates/webcatalog/app_carousel_widget.html 2012-04-19 09:49:41 +0000 | |||
341 | +++ src/webcatalog/templates/webcatalog/app_carousel_widget.html 2013-04-15 13:23:28 +0000 | |||
342 | @@ -14,8 +14,8 @@ | |||
343 | 14 | <table class="apps"><tr> | 14 | <table class="apps"><tr> |
344 | 15 | {% for app in apps %} | 15 | {% for app in apps %} |
345 | 16 | <td{% if forloop.counter|divisibleby:3 %} class="lastcol"{% endif %}> | 16 | <td{% if forloop.counter|divisibleby:3 %} class="lastcol"{% endif %}> |
348 | 17 | <a href="{% url wc-package-detail package_name=app.package_name %}"><img class="icon64" src="{{ app.icon_url_or_default }}"/></a> | 17 | <a href="{% url 'wc-package-detail' package_name=app.package_name %}"><img class="icon64" src="{{ app.icon_url_or_default }}"/></a> |
349 | 18 | <h4><a href="{% url wc-package-detail package_name=app.package_name %}">{{ app.name }}</a></h4> | 18 | <h4><a href="{% url 'wc-package-detail' package_name=app.package_name %}">{{ app.name }}</a></h4> |
350 | 19 | <p>{{ app.departments.all.0.name }} | <b>{% if app.price %}${{ app.price }}{% else %}FREE{% endif %}</b></p> | 19 | <p>{{ app.departments.all.0.name }} | <b>{% if app.price %}${{ app.price }}{% else %}FREE{% endif %}</b></p> |
351 | 20 | <p>{{ app.comment }}</p> | 20 | <p>{{ app.comment }}</p> |
352 | 21 | {% if ratings %} | 21 | {% if ratings %} |
353 | 22 | 22 | ||
354 | === modified file 'src/webcatalog/templates/webcatalog/application_detail.html' | |||
355 | --- src/webcatalog/templates/webcatalog/application_detail.html 2012-09-06 10:38:18 +0000 | |||
356 | +++ src/webcatalog/templates/webcatalog/application_detail.html 2013-04-15 13:23:28 +0000 | |||
357 | @@ -5,13 +5,13 @@ | |||
358 | 5 | {% block title %}{{ application.name }} — Ubuntu Apps Directory{% endblock %} | 5 | {% block title %}{{ application.name }} — Ubuntu Apps Directory{% endblock %} |
359 | 6 | {% block header %}{{ application.name }}{% endblock %} | 6 | {% block header %}{{ application.name }}{% endblock %} |
360 | 7 | {% block head_extra %} | 7 | {% block head_extra %} |
363 | 8 | <link rel="stylesheet" type="text/css" href="{% url wc-combo %}?light/css/reset.css&light/css/styles.css&css/webcatalog.css&light/css/forms.css&css/carousel.css"/> | 8 | <link rel="stylesheet" type="text/css" href="{% url 'wc-combo' %}?light/css/reset.css&light/css/styles.css&css/webcatalog.css&light/css/forms.css&css/carousel.css"/> |
364 | 9 | <script src="{% url wc-combo %}?yui/3.4.0/build/yui/yui-min.js&js/carousel.js&js/screenshots.js"></script> | 9 | <script src="{% url 'wc-combo' %}?yui/3.4.0/build/yui/yui-min.js&js/carousel.js&js/screenshots.js"></script> |
365 | 10 | <script> | 10 | <script> |
367 | 11 | YUI({combine: true, comboBase: '{% url wc-combo %}?', root: 'yui/3.4.0/build/'}).use('io-base', 'node-base', function (Y) { | 11 | YUI({combine: true, comboBase: '{% url 'wc-combo' %}?', root: 'yui/3.4.0/build/'}).use('io-base', 'node-base', function (Y) { |
368 | 12 | 12 | ||
369 | 13 | // XXX michaeln 2011-09-16 bug=851660 Autoload further batches of results. | 13 | // XXX michaeln 2011-09-16 bug=851660 Autoload further batches of results. |
371 | 14 | var reviews_uri = "{% url wc-package-reviews-ajax application.distroseries.code_name application.package_name %}"; | 14 | var reviews_uri = "{% url 'wc-package-reviews-ajax' application.distroseries.code_name application.package_name %}"; |
372 | 15 | Y.io(reviews_uri, { | 15 | Y.io(reviews_uri, { |
373 | 16 | on: { | 16 | on: { |
374 | 17 | complete: function(id, response){ | 17 | complete: function(id, response){ |
375 | @@ -25,7 +25,7 @@ | |||
376 | 25 | }); | 25 | }); |
377 | 26 | var recommends_div = Y.one('.portlet.recommendedportlet'); | 26 | var recommends_div = Y.one('.portlet.recommendedportlet'); |
378 | 27 | if (recommends_div){ | 27 | if (recommends_div){ |
380 | 28 | var recommendations_uri = "{% url wc-package-recommends application.package_name %}"; | 28 | var recommendations_uri = "{% url 'wc-package-recommends' application.package_name %}"; |
381 | 29 | Y.io(recommendations_uri, { | 29 | Y.io(recommendations_uri, { |
382 | 30 | on: { | 30 | on: { |
383 | 31 | complete: function(id, response){ | 31 | complete: function(id, response){ |
384 | @@ -59,7 +59,7 @@ | |||
385 | 59 | {% ifequal distroseries.code_name requested_series_codename %} | 59 | {% ifequal distroseries.code_name requested_series_codename %} |
386 | 60 | <span>{% include "webcatalog/distroseries_snippet.html" %}</span> | 60 | <span>{% include "webcatalog/distroseries_snippet.html" %}</span> |
387 | 61 | {% else %} | 61 | {% else %} |
389 | 62 | <a href="{% url wc-package-detail distroseries.code_name application.package_name %}">{% include "webcatalog/distroseries_snippet.html" %}</a> | 62 | <a href="{% url 'wc-package-detail' distroseries.code_name application.package_name %}">{% include "webcatalog/distroseries_snippet.html" %}</a> |
390 | 63 | {% endifequal %}</li> | 63 | {% endifequal %}</li> |
391 | 64 | {% endfor %} | 64 | {% endfor %} |
392 | 65 | </ul> | 65 | </ul> |
393 | @@ -142,7 +142,7 @@ | |||
394 | 142 | <div class="reviews"> | 142 | <div class="reviews"> |
395 | 143 | <h2>{% trans "Reviews" %}</h2> | 143 | <h2>{% trans "Reviews" %}</h2> |
396 | 144 | <div id="reviews_placeholder"> | 144 | <div id="reviews_placeholder"> |
398 | 145 | <a href="{% url wc-package-reviews application.distroseries.code_name application.package_name %}"> | 145 | <a href="{% url 'wc-package-reviews' application.distroseries.code_name application.package_name %}"> |
399 | 146 | {% blocktrans %}View the reviews for this app{% endblocktrans %}</a> | 146 | {% blocktrans %}View the reviews for this app{% endblocktrans %}</a> |
400 | 147 | </div> | 147 | </div> |
401 | 148 | </div> | 148 | </div> |
402 | 149 | 149 | ||
403 | === modified file 'src/webcatalog/templates/webcatalog/application_list_snippet.html' | |||
404 | --- src/webcatalog/templates/webcatalog/application_list_snippet.html 2012-05-08 06:42:38 +0000 | |||
405 | +++ src/webcatalog/templates/webcatalog/application_list_snippet.html 2013-04-15 13:23:28 +0000 | |||
406 | @@ -4,11 +4,11 @@ | |||
407 | 4 | <tr> | 4 | <tr> |
408 | 5 | <td class="app-icon"> | 5 | <td class="app-icon"> |
409 | 6 | 6 | ||
411 | 7 | <a href="{% if distroseries %}{% url wc-package-detail app.distroseries.code_name app.package_name %}{% else %}{% url wc-package-detail app.package_name %}{% endif %}"><img src="{{ app.icon_url_or_default }}" class="icon32"/></a> | 7 | <a href="{% if distroseries %}{% url 'wc-package-detail' app.distroseries.code_name app.package_name %}{% else %}{% url 'wc-package-detail' app.package_name %}{% endif %}"><img src="{{ app.icon_url_or_default }}" class="icon32"/></a> |
412 | 8 | </td> | 8 | </td> |
413 | 9 | <td class="app-description"> | 9 | <td class="app-description"> |
414 | 10 | <h3> | 10 | <h3> |
416 | 11 | <a href="{% if distroseries %}{% url wc-package-detail app.distroseries.code_name app.package_name %}{% else %}{% url wc-package-detail app.package_name %}{% endif %}">{{ app.name }}</a> | 11 | <a href="{% if distroseries %}{% url 'wc-package-detail' app.distroseries.code_name app.package_name %}{% else %}{% url 'wc-package-detail' app.package_name %}{% endif %}">{{ app.name }}</a> |
417 | 12 | </h3> | 12 | </h3> |
418 | 13 | <p>{{ app.comment }}</p> | 13 | <p>{{ app.comment }}</p> |
419 | 14 | </td> | 14 | </td> |
420 | 15 | 15 | ||
421 | === modified file 'src/webcatalog/templates/webcatalog/base.html' | |||
422 | --- src/webcatalog/templates/webcatalog/base.html 2012-06-28 14:27:43 +0000 | |||
423 | +++ src/webcatalog/templates/webcatalog/base.html 2013-04-15 13:23:28 +0000 | |||
424 | @@ -4,12 +4,12 @@ | |||
425 | 4 | {% block menus %}{% endblock %} | 4 | {% block menus %}{% endblock %} |
426 | 5 | 5 | ||
427 | 6 | {% block head_extra %} | 6 | {% block head_extra %} |
429 | 7 | <link rel="stylesheet" type="text/css" href="{% url wc-combo %}?light/css/reset.css&light/css/styles.css&css/webcatalog.css&light/css/forms.css"/> | 7 | <link rel="stylesheet" type="text/css" href="{% url 'wc-combo' %}?light/css/reset.css&light/css/styles.css&css/webcatalog.css&light/css/forms.css"/> |
430 | 8 | {% endblock %} | 8 | {% endblock %} |
431 | 9 | 9 | ||
432 | 10 | {% block search %} | 10 | {% block search %} |
433 | 11 | <div id="search-box"> | 11 | <div id="search-box"> |
435 | 12 | <form id="sitesearch" action="{% url wc-search %}" method="get"> | 12 | <form id="sitesearch" action="{% url 'wc-search' %}" method="get"> |
436 | 13 | <input type="text" maxlength="128" name="q" id="search-box-input" | 13 | <input type="text" maxlength="128" name="q" id="search-box-input" |
437 | 14 | placeholder="Search for an app" title="Add some words that describe the app or the app's name." | 14 | placeholder="Search for an app" title="Add some words that describe the app or the app's name." |
438 | 15 | /> | 15 | /> |
439 | @@ -22,7 +22,7 @@ | |||
440 | 22 | <div class="footer-div"> | 22 | <div class="footer-div"> |
441 | 23 | <p class="footer-title">Legal</p> | 23 | <p class="footer-title">Legal</p> |
442 | 24 | <ul> | 24 | <ul> |
444 | 25 | <li><a href="{% url wc-tos %}">Terms of Service</a></li> | 25 | <li><a href="{% url 'wc-tos' %}">Terms of Service</a></li> |
445 | 26 | <li><a href="https://one.ubuntu.com/privacy/">Privacy Policy</a></li> | 26 | <li><a href="https://one.ubuntu.com/privacy/">Privacy Policy</a></li> |
446 | 27 | </ul> | 27 | </ul> |
447 | 28 | </div> | 28 | </div> |
448 | 29 | 29 | ||
449 | === modified file 'src/webcatalog/templates/webcatalog/department_overview.html' | |||
450 | --- src/webcatalog/templates/webcatalog/department_overview.html 2012-05-08 06:42:38 +0000 | |||
451 | +++ src/webcatalog/templates/webcatalog/department_overview.html 2013-04-15 13:23:28 +0000 | |||
452 | @@ -26,7 +26,7 @@ | |||
453 | 26 | {% ifequal ds.code_name distroseries %} | 26 | {% ifequal ds.code_name distroseries %} |
454 | 27 | <span>Ubuntu {{ ds.version }} ({{ ds.code_name }})</span> | 27 | <span>Ubuntu {{ ds.version }} ({{ ds.code_name }})</span> |
455 | 28 | {% else %} | 28 | {% else %} |
457 | 29 | <a href="{% url wc-department distro=ds.code_name dept_slug_or_id=dept.slug %}">Ubuntu {{ ds.version }} ({{ ds.code_name }})</a> | 29 | <a href="{% url 'wc-department' distro=ds.code_name dept_slug_or_id=dept.slug %}">Ubuntu {{ ds.version }} ({{ ds.code_name }})</a> |
458 | 30 | {% endifequal %}</li> | 30 | {% endifequal %}</li> |
459 | 31 | {% endfor %} | 31 | {% endfor %} |
460 | 32 | </ul> | 32 | </ul> |
461 | 33 | 33 | ||
462 | === modified file 'src/webcatalog/templates/webcatalog/department_overview_snippet.html' | |||
463 | --- src/webcatalog/templates/webcatalog/department_overview_snippet.html 2012-04-05 01:09:37 +0000 | |||
464 | +++ src/webcatalog/templates/webcatalog/department_overview_snippet.html 2013-04-15 13:23:28 +0000 | |||
465 | @@ -1,5 +1,5 @@ | |||
466 | 1 | <li class="department"> | 1 | <li class="department"> |
468 | 2 | <a href="{% url wc-department dept_slug_or_id=dept.slug %}"> | 2 | <a href="{% url 'wc-department' dept_slug_or_id=dept.slug %}"> |
469 | 3 | <div class="dept-icon"> | 3 | <div class="dept-icon"> |
470 | 4 | <img width="24" height="24" | 4 | <img width="24" height="24" |
471 | 5 | src="{{ STATIC_URL }}images/dept_icons/{{ dept.slug }}.png"/> | 5 | src="{{ STATIC_URL }}images/dept_icons/{{ dept.slug }}.png"/> |
472 | 6 | 6 | ||
473 | === modified file 'src/webcatalog/templates/webcatalog/exhibits_widget.html' | |||
474 | --- src/webcatalog/templates/webcatalog/exhibits_widget.html 2012-08-21 13:47:14 +0000 | |||
475 | +++ src/webcatalog/templates/webcatalog/exhibits_widget.html 2013-04-15 13:23:28 +0000 | |||
476 | @@ -20,7 +20,7 @@ | |||
477 | 20 | </div> | 20 | </div> |
478 | 21 | </div> | 21 | </div> |
479 | 22 | <script type="text/javascript"> | 22 | <script type="text/javascript"> |
481 | 23 | YUI({combine: true, comboBase: '{% url wc-combo %}?', root: 'yui/3.4.0/build/'}).use('uwc-carousel', function(Y) { | 23 | YUI({combine: true, comboBase: '{% url 'wc-combo' %}?', root: 'yui/3.4.0/build/'}).use('uwc-carousel', function(Y) { |
482 | 24 | var caro = new Y.uwc.Carousel({ | 24 | var caro = new Y.uwc.Carousel({ |
483 | 25 | nodeContainer: "#exhibits-carousel", | 25 | nodeContainer: "#exhibits-carousel", |
484 | 26 | controlsContainer: "#exhibits-carousel", | 26 | controlsContainer: "#exhibits-carousel", |
485 | 27 | 27 | ||
486 | === modified file 'src/webcatalog/templates/webcatalog/featured_apps_widget.html' | |||
487 | --- src/webcatalog/templates/webcatalog/featured_apps_widget.html 2012-04-18 15:15:56 +0000 | |||
488 | +++ src/webcatalog/templates/webcatalog/featured_apps_widget.html 2013-04-15 13:23:28 +0000 | |||
489 | @@ -6,7 +6,7 @@ | |||
490 | 6 | {% endwith %} | 6 | {% endwith %} |
491 | 7 | </div> | 7 | </div> |
492 | 8 | <script type="text/javascript"> | 8 | <script type="text/javascript"> |
494 | 9 | YUI({combine: true, comboBase: '{% url wc-combo %}?', root: 'yui/3.4.0/build/'}).use('uwc-carousel', function(Y) { | 9 | YUI({combine: true, comboBase: '{% url 'wc-combo' %}?', root: 'yui/3.4.0/build/'}).use('uwc-carousel', function(Y) { |
495 | 10 | var caro = new Y.uwc.Carousel({ | 10 | var caro = new Y.uwc.Carousel({ |
496 | 11 | nodeContainer: "#featured-carousel .carousel", | 11 | nodeContainer: "#featured-carousel .carousel", |
497 | 12 | controlsContainer: "#featured-carousel .carousel-controls", | 12 | controlsContainer: "#featured-carousel .carousel-controls", |
498 | 13 | 13 | ||
499 | === modified file 'src/webcatalog/templates/webcatalog/index.html' | |||
500 | --- src/webcatalog/templates/webcatalog/index.html 2012-04-18 10:38:33 +0000 | |||
501 | +++ src/webcatalog/templates/webcatalog/index.html 2013-04-15 13:23:28 +0000 | |||
502 | @@ -6,8 +6,8 @@ | |||
503 | 6 | {% block search %}{% endblock %} | 6 | {% block search %}{% endblock %} |
504 | 7 | 7 | ||
505 | 8 | {% block head_extra %} | 8 | {% block head_extra %} |
508 | 9 | <link rel="stylesheet" type="text/css" href="{% url wc-combo %}?light/css/reset.css&light/css/styles.css&css/webcatalog.css&light/css/forms.css&css/carousel.css"/> | 9 | <link rel="stylesheet" type="text/css" href="{% url 'wc-combo' %}?light/css/reset.css&light/css/styles.css&css/webcatalog.css&light/css/forms.css&css/carousel.css"/> |
509 | 10 | <script src="{% url wc-combo %}?yui/3.4.0/build/yui/yui-min.js&js/carousel.js"></script> | 10 | <script src="{% url 'wc-combo' %}?yui/3.4.0/build/yui/yui-min.js&js/carousel.js"></script> |
510 | 11 | {% endblock %} | 11 | {% endblock %} |
511 | 12 | 12 | ||
512 | 13 | 13 | ||
513 | @@ -35,7 +35,7 @@ | |||
514 | 35 | <h3>{% trans "Search for an app" %}:</h3> | 35 | <h3>{% trans "Search for an app" %}:</h3> |
515 | 36 | 36 | ||
516 | 37 | <div id="search-box" class="main"> | 37 | <div id="search-box" class="main"> |
518 | 38 | <form id="sitesearch" action="{% url wc-search %}" method="get"> | 38 | <form id="sitesearch" action="{% url 'wc-search' %}" method="get"> |
519 | 39 | <input type="text" maxlength="128" name="q" id="search-box-input" | 39 | <input type="text" maxlength="128" name="q" id="search-box-input" |
520 | 40 | title="Add some words that describe the app or the app's name."/> | 40 | title="Add some words that describe the app or the app's name."/> |
521 | 41 | <button type="submit" name="op" id="search-box-button"><span>go</span></button> | 41 | <button type="submit" name="op" id="search-box-button"><span>go</span></button> |
522 | 42 | 42 | ||
523 | === modified file 'src/webcatalog/templates/webcatalog/recommended_apps_widget.html' | |||
524 | --- src/webcatalog/templates/webcatalog/recommended_apps_widget.html 2012-04-20 18:33:58 +0000 | |||
525 | +++ src/webcatalog/templates/webcatalog/recommended_apps_widget.html 2013-04-15 13:23:28 +0000 | |||
526 | @@ -4,7 +4,7 @@ | |||
527 | 4 | <ul class="portletactions"> | 4 | <ul class="portletactions"> |
528 | 5 | {% for app in recommended_apps %} | 5 | {% for app in recommended_apps %} |
529 | 6 | <li> | 6 | <li> |
531 | 7 | <a href="{% url wc-package-detail package_name=app.package_name %}"> | 7 | <a href="{% url 'wc-package-detail' package_name=app.package_name %}"> |
532 | 8 | <div class="top-rated-stars"> | 8 | <div class="top-rated-stars"> |
533 | 9 | {% rating_summary app.ratings_average 'small' app.ratings_total %} | 9 | {% rating_summary app.ratings_average 'small' app.ratings_total %} |
534 | 10 | </div> | 10 | </div> |
535 | 11 | 11 | ||
536 | === modified file 'src/webcatalog/templates/webcatalog/search_results.html' | |||
537 | --- src/webcatalog/templates/webcatalog/search_results.html 2012-05-08 06:42:38 +0000 | |||
538 | +++ src/webcatalog/templates/webcatalog/search_results.html 2013-04-15 13:23:28 +0000 | |||
539 | @@ -15,7 +15,7 @@ | |||
540 | 15 | {% ifequal ds.code_name distroseries %} | 15 | {% ifequal ds.code_name distroseries %} |
541 | 16 | <span>Ubuntu {{ ds.version }} ({{ ds.code_name }})</span> | 16 | <span>Ubuntu {{ ds.version }} ({{ ds.code_name }})</span> |
542 | 17 | {% else %} | 17 | {% else %} |
544 | 18 | <a href="{% url wc-search ds.code_name %}?q={{query}}">Ubuntu {{ ds.version }} ({{ ds.code_name }})</a> | 18 | <a href="{% url 'wc-search' ds.code_name %}?q={{query}}">Ubuntu {{ ds.version }} ({{ ds.code_name }})</a> |
545 | 19 | {% endifequal %}</li> | 19 | {% endifequal %}</li> |
546 | 20 | {% endfor %} | 20 | {% endfor %} |
547 | 21 | </ul> | 21 | </ul> |
548 | 22 | 22 | ||
549 | === modified file 'src/webcatalog/templates/webcatalog/task_list.html' | |||
550 | --- src/webcatalog/templates/webcatalog/task_list.html 2012-06-29 19:51:06 +0000 | |||
551 | +++ src/webcatalog/templates/webcatalog/task_list.html 2013-04-15 13:23:28 +0000 | |||
552 | @@ -5,7 +5,7 @@ | |||
553 | 5 | {% block header %}{% trans "Schedule asynchronous tasks" %}{% endblock %} | 5 | {% block header %}{% trans "Schedule asynchronous tasks" %}{% endblock %} |
554 | 6 | {% block head_extra %} | 6 | {% block head_extra %} |
555 | 7 | {{ block.super }} | 7 | {{ block.super }} |
557 | 8 | <script src="{% url wc-combo %}?yui/3.4.0/build/yui/yui-min.js"></script> | 8 | <script src="{% url 'wc-combo' %}?yui/3.4.0/build/yui/yui-min.js"></script> |
558 | 9 | <style type="text/css"> | 9 | <style type="text/css"> |
559 | 10 | div.task button { | 10 | div.task button { |
560 | 11 | width: 200px; | 11 | width: 200px; |
561 | @@ -22,7 +22,7 @@ | |||
562 | 22 | } | 22 | } |
563 | 23 | </style> | 23 | </style> |
564 | 24 | <script> | 24 | <script> |
566 | 25 | YUI({combine: true, comboBase: '{% url wc-combo %}?', root: 'yui/3.4.0/build/'}).use('io-base', 'node-base', function (Y) { | 25 | YUI({combine: true, comboBase: '{% url 'wc-combo' %}?', root: 'yui/3.4.0/build/'}).use('io-base', 'node-base', function (Y) { |
567 | 26 | var check_status = function(task_id, message) { | 26 | var check_status = function(task_id, message) { |
568 | 27 | var check_uri = "/cat/task_status/" + task_id + '/'; | 27 | var check_uri = "/cat/task_status/" + task_id + '/'; |
569 | 28 | var UNREADY_STATES = ["PENDING", "RECEIVED", "STARTED", "RETRY"]; | 28 | var UNREADY_STATES = ["PENDING", "RECEIVED", "STARTED", "RETRY"]; |
570 | 29 | 29 | ||
571 | === modified file 'src/webcatalog/templates/webcatalog/top_rated_apps_widget.html' | |||
572 | --- src/webcatalog/templates/webcatalog/top_rated_apps_widget.html 2012-04-18 15:15:56 +0000 | |||
573 | +++ src/webcatalog/templates/webcatalog/top_rated_apps_widget.html 2013-04-15 13:23:28 +0000 | |||
574 | @@ -6,7 +6,7 @@ | |||
575 | 6 | {% endwith %} | 6 | {% endwith %} |
576 | 7 | </div> | 7 | </div> |
577 | 8 | <script type="text/javascript"> | 8 | <script type="text/javascript"> |
579 | 9 | YUI({combine: true, comboBase: '{% url wc-combo %}?', root: 'yui/3.4.0/build/'}).use('uwc-carousel', function(Y) { | 9 | YUI({combine: true, comboBase: '{% url 'wc-combo' %}?', root: 'yui/3.4.0/build/'}).use('uwc-carousel', function(Y) { |
580 | 10 | var caro = new Y.uwc.Carousel({ | 10 | var caro = new Y.uwc.Carousel({ |
581 | 11 | nodeContainer: "#top-rated-carousel .carousel", | 11 | nodeContainer: "#top-rated-carousel .carousel", |
582 | 12 | controlsContainer: "#top-rated-carousel .carousel-controls", | 12 | controlsContainer: "#top-rated-carousel .carousel-controls", |
583 | 13 | 13 | ||
584 | === modified file 'src/webcatalog/tests/factory.py' | |||
585 | --- src/webcatalog/tests/factory.py 2012-09-06 10:08:33 +0000 | |||
586 | +++ src/webcatalog/tests/factory.py 2013-04-15 13:23:28 +0000 | |||
587 | @@ -20,6 +20,8 @@ | |||
588 | 20 | from __future__ import absolute_import | 20 | from __future__ import absolute_import |
589 | 21 | 21 | ||
590 | 22 | import os | 22 | import os |
591 | 23 | import pytz | ||
592 | 24 | |||
593 | 23 | from datetime import ( | 25 | from datetime import ( |
594 | 24 | datetime, | 26 | datetime, |
595 | 25 | timedelta, | 27 | timedelta, |
596 | @@ -244,7 +246,7 @@ | |||
597 | 244 | def make_session(self, expire_date=None): | 246 | def make_session(self, expire_date=None): |
598 | 245 | if expire_date is None: | 247 | if expire_date is None: |
599 | 246 | secs = self.get_unique_integer() | 248 | secs = self.get_unique_integer() |
601 | 247 | expire_date = datetime.now() + timedelta(seconds=secs) | 249 | expire_date = datetime.now(pytz.utc) + timedelta(seconds=secs) |
602 | 248 | return Session.objects.create( | 250 | return Session.objects.create( |
603 | 249 | session_key=self.get_unique_string(prefix='key-'), | 251 | session_key=self.get_unique_string(prefix='key-'), |
604 | 250 | session_data=self.get_unique_string(prefix='session-data-'), | 252 | session_data=self.get_unique_string(prefix='session-data-'), |
605 | 251 | 253 | ||
606 | === modified file 'src/webcatalog/tests/test_commands.py' | |||
607 | --- src/webcatalog/tests/test_commands.py 2013-02-18 21:55:09 +0000 | |||
608 | +++ src/webcatalog/tests/test_commands.py 2013-04-15 13:23:28 +0000 | |||
609 | @@ -22,8 +22,10 @@ | |||
610 | 22 | import apt | 22 | import apt |
611 | 23 | import json | 23 | import json |
612 | 24 | import os | 24 | import os |
613 | 25 | import pytz | ||
614 | 25 | import shutil | 26 | import shutil |
615 | 26 | import tempfile | 27 | import tempfile |
616 | 28 | |||
617 | 27 | from datetime import ( | 29 | from datetime import ( |
618 | 28 | datetime, | 30 | datetime, |
619 | 29 | timedelta, | 31 | timedelta, |
620 | @@ -760,7 +762,7 @@ | |||
621 | 760 | 762 | ||
622 | 761 | def test_updates_last_import_record(self): | 763 | def test_updates_last_import_record(self): |
623 | 762 | onion = self.factory.make_distroseries(code_name='onion') | 764 | onion = self.factory.make_distroseries(code_name='onion') |
625 | 763 | orig_timestamp = datetime(2011, 07, 18, 14, 43) | 765 | orig_timestamp = datetime(2011, 07, 18, 14, 43, tzinfo=pytz.utc) |
626 | 764 | ReviewStatsImport.objects.create( | 766 | ReviewStatsImport.objects.create( |
627 | 765 | distroseries=onion, last_import=orig_timestamp) | 767 | distroseries=onion, last_import=orig_timestamp) |
628 | 766 | 768 | ||
629 | @@ -784,7 +786,7 @@ | |||
630 | 784 | # If there has been a recent import, we'll only grab the | 786 | # If there has been a recent import, we'll only grab the |
631 | 785 | # relevant stats. | 787 | # relevant stats. |
632 | 786 | onion = self.factory.make_distroseries(code_name='onion') | 788 | onion = self.factory.make_distroseries(code_name='onion') |
634 | 787 | orig_timestamp = datetime.utcnow() - timedelta(2) | 789 | orig_timestamp = datetime.now(pytz.utc) - timedelta(2) |
635 | 788 | ReviewStatsImport.objects.create( | 790 | ReviewStatsImport.objects.create( |
636 | 789 | distroseries=onion, last_import=orig_timestamp) | 791 | distroseries=onion, last_import=orig_timestamp) |
637 | 790 | 792 | ||
638 | @@ -797,8 +799,8 @@ | |||
639 | 797 | # If the download_all option is used, all stats are | 799 | # If the download_all option is used, all stats are |
640 | 798 | # downloaded, rather than the optimised last X days. | 800 | # downloaded, rather than the optimised last X days. |
641 | 799 | onion = self.factory.make_distroseries(code_name='onion') | 801 | onion = self.factory.make_distroseries(code_name='onion') |
644 | 800 | orig_timestamp = datetime.utcnow() - timedelta(2) | 802 | orig_timestamp = datetime.now(pytz.utc) - timedelta(2) |
645 | 801 | import_record = ReviewStatsImport.objects.create( | 803 | ReviewStatsImport.objects.create( |
646 | 802 | distroseries=onion, last_import=orig_timestamp) | 804 | distroseries=onion, last_import=orig_timestamp) |
647 | 803 | 805 | ||
648 | 804 | call_command('import_ratings_stats', 'onion', download_all=True) | 806 | call_command('import_ratings_stats', 'onion', download_all=True) |
649 | @@ -1093,12 +1095,12 @@ | |||
650 | 1093 | All done. | 1095 | All done. |
651 | 1094 | ''' | 1096 | ''' |
652 | 1095 | actual_output = ''.join( | 1097 | actual_output = ''.join( |
654 | 1096 | str(call[0][0]) for call in self.mock_stdout.write.call_args_list) | 1098 | str(c[0][0]) for c in self.mock_stdout.write.call_args_list) |
655 | 1097 | self.assertEqual(expected_output, actual_output) | 1099 | self.assertEqual(expected_output, actual_output) |
656 | 1098 | 1100 | ||
657 | 1099 | @skipUnless(connection.vendor == 'postgresql', "Requires postgresql") | 1101 | @skipUnless(connection.vendor == 'postgresql', "Requires postgresql") |
658 | 1100 | def test_cleanup_nonces(self): | 1102 | def test_cleanup_nonces(self): |
660 | 1101 | now = datetime.now() | 1103 | now = datetime.now(pytz.utc) |
661 | 1102 | for i in range(8): | 1104 | for i in range(8): |
662 | 1103 | created_at = now - timedelta(seconds=5000 * i) | 1105 | created_at = now - timedelta(seconds=5000 * i) |
663 | 1104 | self.factory.make_nonce(created_at=created_at) | 1106 | self.factory.make_nonce(created_at=created_at) |
664 | @@ -1120,7 +1122,7 @@ | |||
665 | 1120 | self.check_expected_output() | 1122 | self.check_expected_output() |
666 | 1121 | 1123 | ||
667 | 1122 | def create_django_sessions(self): | 1124 | def create_django_sessions(self): |
669 | 1123 | now = datetime.now() | 1125 | now = datetime.now(pytz.utc) |
670 | 1124 | for i in range(8): | 1126 | for i in range(8): |
671 | 1125 | expire_date = now + timedelta(seconds=5000 * (4 - i)) | 1127 | expire_date = now + timedelta(seconds=5000 * (4 - i)) |
672 | 1126 | self.factory.make_session(expire_date=expire_date) | 1128 | self.factory.make_session(expire_date=expire_date) |
673 | @@ -1131,7 +1133,7 @@ | |||
674 | 1131 | 1133 | ||
675 | 1132 | call_command('cleanup', 'django_session', batch_secs=0) | 1134 | call_command('cleanup', 'django_session', batch_secs=0) |
676 | 1133 | 1135 | ||
678 | 1134 | self.assertEqual(0, Session.objects.count()) | 1136 | self.assertEqual(4, Session.objects.count()) |
679 | 1135 | 1137 | ||
680 | 1136 | 1138 | ||
681 | 1137 | class ImportAllAppInstallDataTestCase(TestCaseWithFactory): | 1139 | class ImportAllAppInstallDataTestCase(TestCaseWithFactory): |
682 | 1138 | 1140 | ||
683 | === modified file 'src/webcatalog/tests/test_preflight.py' | |||
684 | --- src/webcatalog/tests/test_preflight.py 2012-10-17 07:46:31 +0000 | |||
685 | +++ src/webcatalog/tests/test_preflight.py 2013-04-15 13:23:28 +0000 | |||
686 | @@ -85,7 +85,7 @@ | |||
687 | 85 | 'preflight', | 85 | 'preflight', |
688 | 86 | ]) | 86 | ]) |
689 | 87 | expected_checks = set([ | 87 | expected_checks = set([ |
691 | 88 | ('validate_config', True), | 88 | ('validate_config', False), |
692 | 89 | ('database', True), | 89 | ('database', True), |
693 | 90 | ('rnr_available', True), | 90 | ('rnr_available', True), |
694 | 91 | ('identity_provider_available', True), | 91 | ('identity_provider_available', True), |
695 | 92 | 92 | ||
696 | === modified file 'src/webcatalog/tests/test_views.py' | |||
697 | --- src/webcatalog/tests/test_views.py 2013-03-01 16:28:52 +0000 | |||
698 | +++ src/webcatalog/tests/test_views.py 2013-04-15 13:23:28 +0000 | |||
699 | @@ -399,7 +399,7 @@ | |||
700 | 399 | 399 | ||
701 | 400 | self.assertNotContains(response, | 400 | self.assertNotContains(response, |
702 | 401 | 'Success. Your download link has been sent.') | 401 | 'Success. Your download link has been sent.') |
704 | 402 | self.assertContains(response, 'Enter a valid e-mail address.') | 402 | self.assertContains(response, 'Enter a valid email address.') |
705 | 403 | 403 | ||
706 | 404 | def test_version_and_label_displayed(self): | 404 | def test_version_and_label_displayed(self): |
707 | 405 | app = self.factory.make_application( | 405 | app = self.factory.make_application( |
708 | 406 | 406 | ||
709 | === modified file 'src/webcatalog/views.py' | |||
710 | --- src/webcatalog/views.py 2013-03-01 12:49:55 +0000 | |||
711 | +++ src/webcatalog/views.py 2013-04-15 13:23:28 +0000 | |||
712 | @@ -109,7 +109,7 @@ | |||
713 | 109 | paginator = Paginator(apps, settings.PAGE_BATCH_SIZE) | 109 | paginator = Paginator(apps, settings.PAGE_BATCH_SIZE) |
714 | 110 | page_num = _get_page_num_from_request(request, paginator) | 110 | page_num = _get_page_num_from_request(request, paginator) |
715 | 111 | 111 | ||
717 | 112 | context = RequestContext(request, dict={ | 112 | context = RequestContext(request, { |
718 | 113 | 'query': query, | 113 | 'query': query, |
719 | 114 | 'page': paginator.page(page_num), | 114 | 'page': paginator.page(page_num), |
720 | 115 | 'breadcrumbs': crumbs, | 115 | 'breadcrumbs': crumbs, |
721 | @@ -140,7 +140,7 @@ | |||
722 | 140 | if len(top_rated) == settings.NUMBER_TOP_RATED_APPS: | 140 | if len(top_rated) == settings.NUMBER_TOP_RATED_APPS: |
723 | 141 | break | 141 | break |
724 | 142 | 142 | ||
726 | 143 | context = RequestContext(request, dict={ | 143 | context = RequestContext(request, { |
727 | 144 | 'depts': depts, | 144 | 'depts': depts, |
728 | 145 | 'exhibits': exhibits, | 145 | 'exhibits': exhibits, |
729 | 146 | 'featured_apps': featured_apps, | 146 | 'featured_apps': featured_apps, |
730 | 147 | 147 | ||
731 | === modified file 'test_requirements.txt' | |||
732 | --- test_requirements.txt 2012-03-26 16:29:35 +0000 | |||
733 | +++ test_requirements.txt 2013-04-15 13:23:28 +0000 | |||
734 | @@ -1,9 +1,4 @@ | |||
735 | 1 | # django should not be required here, but without it `python setup.py develop` | ||
736 | 2 | # complains with: | ||
737 | 3 | # Installed /.../virtualenv/lib/python2.6/site-packages/django_preflight-0.1-py2.6.egg | ||
738 | 4 | # error: Could not find required distribution django | ||
739 | 5 | -f bzr+http://bazaar.launchpad.net/~elachuni/canonical-identity-provider/ssoclient#egg=ssoclient-1.0 | 1 | -f bzr+http://bazaar.launchpad.net/~elachuni/canonical-identity-provider/ssoclient#egg=ssoclient-1.0 |
740 | 6 | django<1.4 | ||
741 | 7 | coverage | 2 | coverage |
742 | 8 | mock | 3 | mock |
743 | 9 | piston-mini-client | 4 | piston-mini-client |
12:54 <noodles> Hey there. Just looking at https:/ /code.launchpad .net/~lukasz- czyzykowski/ ubuntu- webcatalog/ upgrade- to-django- 1.5/+merge/ 158009 _is_string = True' around line 152-54 /bitbucket. org/jespern/ django- piston/ pull-requests
12:54 <noodles> Did you have that same piston surgery in the sca branch? I think I saw it and had a thought, but forgot to comment...
12:55 <noodles> Why wouldn't we fix that it piston instead? (I mean, update piston to use json rather than simplejson). Rather than doing patch-work on all of our apps?
12:58 <lukasz> noodles: I did that for all apps
12:58 <lukasz> noodles: patching seemed a quicker way to the end result than fixing piston
12:58 <lukasz> noodles: but I would really like to fix that dead project
13:01 <noodles> Yeah, it sounds quicker initially, but looks like more work in the long run.
13:01 <noodles> Also, what's the private attribute setting for 'HttpResponse.
13:02 <lukasz> another piston backward compatibility
13:03 <noodles> Hrm... do you mean, we could include the fix in an updated piston also?
13:03 <lukasz> it expects this attribute on the response object, and we never return response with iterator content, so that's why it's hardcoded
13:03 <lukasz> noodles: yup
13:03 <noodles> Do you want me to update piston?
13:04 <lukasz> noodles: I can do it, patches for all of the problems are on bitbucket
13:04 <noodles> Ah, sweet.
13:04 <noodles> Ah of course...
13:04 <lukasz> where do we store patched version?
13:04 <noodles> I was thinking we were talking about piston-mini-client (which is easy for us to update)....
13:04 <lukasz> no, that's django-piston
13:04 <noodles> Yeah,
13:05 <lukasz> which needs to be fixed
13:05 <lukasz> https:/
13:05 <noodles> In which case, +1 for your work-arounds, just include a comment on that previous one.
13:05 <noodles> l152-154
13:05 <lukasz> HttpResponse?
13:05 <lukasz> ok