Here are the examples of the python api geonode.utils.num_encode taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
3
Example 1
def json(self):
return {
"map": self.map.id,
"created": self.created_dttm.isoformat(),
"user": self.user.username if self.user else None,
"url": num_encode(self.id)
}
3
Example 2
Project: geonode Source File: views.py
def snapshot_create(request):
"""
Create a permalinked map
"""
conf = request.body
if isinstance(conf, basestring):
config = json.loads(conf)
snapshot = MapSnapshot.objects.create(
config=clean_config(conf),
map=Map.objects.get(
id=config['id']))
return HttpResponse(num_encode(snapshot.id), content_type="text/plain")
else:
return HttpResponse("Invalid JSON", content_type="text/plain", status=500)