equal
deleted
inserted
replaced
27 |
27 |
28 import itertools |
28 import itertools |
29 |
29 |
30 from google.appengine.ext import db |
30 from google.appengine.ext import db |
31 |
31 |
32 from django.utils.translation import ugettext_lazy |
32 from django.utils.translation import ugettext |
33 |
33 |
34 from soc.logic import dicts |
34 from soc.logic import dicts |
35 from soc.views import out_of_band |
35 from soc.views import out_of_band |
36 |
36 |
37 |
37 |
256 entity = self.getFromFields(**fields) |
256 entity = self.getFromFields(**fields) |
257 |
257 |
258 if entity: |
258 if entity: |
259 return entity |
259 return entity |
260 |
260 |
261 format_text = ugettext_lazy('"%(key)s" is "%(value)s"') |
261 format_text = ugettext('"%(key)s" is "%(value)s"') |
262 |
262 |
263 msg_pairs = [format_text % {'key': key, 'value': value} |
263 msg_pairs = [format_text % {'key': key, 'value': value} |
264 for key, value in fields.iteritems()] |
264 for key, value in fields.iteritems()] |
265 |
265 |
266 joined_pairs = ' and '.join(msg_pairs) |
266 joined_pairs = ' and '.join(msg_pairs) |
267 |
267 |
268 msg = ugettext_lazy( |
268 msg = ugettext( |
269 'There is no "%(name)s" where %(pairs)s.') % { |
269 'There is no "%(name)s" where %(pairs)s.') % { |
270 'name': self._name, 'pairs': joined_pairs} |
270 'name': self._name, 'pairs': joined_pairs} |
271 |
271 |
272 raise out_of_band.Error(msg, status=404) |
272 raise out_of_band.Error(msg, status=404) |
273 |
273 |