# Path: User/models.py
# def check_if_auth_user(request):
# 	if (request.session is not None) and request.session.has_key("user_mail_id"):
# 		return request.session["user_mail_id"]
# 	else:
# 		return None


from django.shortcuts import render, redirect
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.db import connection, transaction
from User.models import check_if_auth_user
from collections import namedtuple
# -*- coding: utf-8 -*-
from __future__ import unicode_literals





def namedtuplefetchall(cursor):
	"Return all rows from a cursor as a namedtuple"
	desc = cursor.description
	nt_result = namedtuple('Result', [col[0] for col in desc])
	return [nt_result(*row) for row in cursor.fetchall()]

# Create your views here.

def weather_query(request, id):

# Path: User/models.py
# def check_if_auth_user(request):
# 	if (request.session is not None) and request.session.has_key("user_mail_id"):
# 		return request.session["user_mail_id"]
# 	else:
# 		return None


# Path: location/views.py
from django.shortcuts import render, redirect
from django.core.urlresolvers import reverse
from django.contrib import messages
from django.db import connection, transaction
from User.models import check_if_auth_user
from collections import namedtuple

# -*- coding: utf-8 -*-
from __future__ import unicode_literals





def namedtuplefetchall(cursor):
	"Return all rows from a cursor as a namedtuple"
	desc = cursor.description
	nt_result = namedtuple('Result', [col[0] for col in desc])
	return [nt_result(*row) for row in cursor.fetchall()]

# Create your views here.

def weather_query(request, id):

	check = check_if_auth_user(request)