本文整理汇总了Python中models.Location.location方法的典型用法代码示例。如果您正苦于以下问题:Python Location.location方法的具体用法?Python Location.location怎么用?Python Location.location使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Location
的用法示例。
在下文中一共展示了Location.location方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: admin_api
# 需要导入模块: from models import Location [as 别名]
# 或者: from models.Location import location [as 别名]
def admin_api(request):
if request.POST['method'] == 'add_location':
try:
l = Location()
l.location = request.POST['location']
l.page = Page.objects.filter(id=request.POST['page']).get()
l.save()
except Exception, e:
print e
return HttpResponse(json.dumps({
'location': l.location,
'id': l.id,
}))
示例2: post
# 需要导入模块: from models import Location [as 别名]
# 或者: from models.Location import location [as 别名]
def post(self):
location = Location()
logging.info(self.request.get('data'))
data = simplejson.loads(self.request.get('data'))
logging.info(data)
if users.get_current_user():
location.author = users.get_current_user()
location.title = data['title']
location.address = data['address']
location.city = data['city']
location.state = data['region']
location.location= data['lat'] + "," + data['lng']
#location.location = "14.584892,121.05747"
location.put()
self.response.out.write('OK')