~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/widgets/location.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-09 09:23:38 UTC
  • mfrom: (14333.2.13 history-model)
  • Revision ID: launchpad@pqm.canonical.com-20111209092338-se7u5l0skqzaes1v
[r=jcsackett][bug=295214, 894836,
 898200] Keep sort button ob bug listing pages in sync with the
 displayed data

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    Float,
27
27
    )
28
28
 
29
 
from lp import _
 
29
from canonical.config import config
 
30
from canonical.launchpad import _
 
31
from canonical.launchpad.webapp.interfaces import (
 
32
    ILaunchBag,
 
33
    IMultiLineWidgetLayout,
 
34
    )
30
35
from lp.app.browser.tales import ObjectImageDisplayAPI
31
36
from lp.app.validators import LaunchpadValidationError
32
37
from lp.registry.interfaces.location import IObjectWithLocation
33
 
from lp.services.config import config
34
38
from lp.services.geoip.interfaces import IGeoIPRecord
35
 
from lp.services.webapp.interfaces import (
36
 
    ILaunchBag,
37
 
    IMultiLineWidgetLayout,
38
 
    )
39
39
 
40
40
 
41
41
class ILocationWidget(IInputWidget, IBrowserWidget, IMultiLineWidgetLayout):
62
62
    __call__ = ViewPageTemplateFile("templates/location.pt")
63
63
 
64
64
    def __init__(self, context, request):
 
65
        # This widget makes use of javascript for googlemaps and
 
66
        # json-handling, so we flag that in the request so that our
 
67
        # base-layout includes the necessary javascript files.
 
68
        request.needs_json = True
65
69
        super(LocationWidget, self).__init__(context, request)
66
70
        fields = form.Fields(
67
71
            Float(__name__='latitude', title=_('Latitude'), required=False),