Welcome to Django Google Map using Fusion Tables’s documentation!

map_app

map_app module

Submodules

map_app.decorators
class map_app.decorators.OAuth2Decorator(client_id, secret, scope)[source]
class OAuth2Decorator
oauth_required(method)[source]

Decorator that starts the OAuth 2.0 dance.

Starts the OAuth dance for the logged in user if they haven’t already granted access for this application.

Args:
method: callable, to be decorated method of a webapp.RequestHandler
instance.
map_app.forms module
class map_app.forms.AddressForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None)[source]

Address form validator

Validate the address is unique and it’s geocode.

save(commit=True, request=None)[source]

Save this form’s self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance.

map_app.models module
class map_app.models.CredentialsModel(id, credential)[source]
exception DoesNotExist
exception MultipleObjectsReturned
class map_app.models.UserTokens(*args, **kwargs)[source]

User token model use for google Oauth authentication.

exception DoesNotExist
exception MultipleObjectsReturned
map_app.utils module
map_app.utils.messages_to_dict(request, to_str=False)[source]

:py:function *message_to_dict*

Returns an iterator that yields a JSON formatted string or dictionary.

Retrieve the _messages from an instance of django.http.request.HttpRequest. :param request: An instance of django.http.request.HttpRequest, :type request: django.http.request.HttpRequest :param to_str: Boolean indication to serialize message object to string. :type to_str: bool :rtype: str|dict

Set the fusion_table_id cookie using the settings.FUSION_TABLE_ID.

Parameters:response (django.http.HttpResponse) – An instance of response object.
Returns:An instance of the HttpResponse object.
Return type:django.http.HttpResponse

Verify the google fusion table_id is set on the request.

Parameters:
  • request (django.http.request.HttpRequest) – HttpRequest object
  • response (django.http.response.HttpResponse.) – HttpResponse object
map_app.views module
class map_app.views.FusionTableHandler(**kwargs)[source]

Bases: django.views.generic.base.TemplateView, map_app.lib.FusionTableMixin

map_app.views.address_view(request)[source]

Render a table of valid searched/clicked addresses.

map_app.lib module
class map_app.lib.FlowClient(request, client_secret_json='/home/docs/checkouts/readthedocs.org/user_builds/django-google-app/checkouts/latest/client_id.json', scope='https://www.googleapis.com/auth/fusiontables', redirect_url='http://localhost:8000/oauth2callback')[source]

FlowClient to manage credentials.

class map_app.lib.FusionTableMixin[source]

Mixin to manage Interactions with google fusion table.

classmethod address_model_to_dict(address)[source]

Convert the map_app.models.Address instance to a dict.

Parameters:address (map_app.models.Address) – The address model instance.
Return type:dict
map_app.lib.verify_client_id_json(filename)[source]

Verify the required client_id.json values are set.

A context manager to parse the client_id.json and set the missing values with the env vars. :param filename: Client id json filename. :type filename: str

Module Contents

Indices and tables