code
stringlengths
3
6.57k
format(new_path)
render_content(content, context)
Context(context or {})
Template(content)
render(ctx)
render_page(page, context, callback)
callback(page, context)
render_content(page_content, context)
render_requested_page_content(sender, request, page)
render_content(content, ctx)
is_acceptable_file_type(path)
path.strip('/')
split('/')
max(map(len, accepted_exts)
filename.index('.')
len(filename)
filename.endswith(a)
get_page_by_path(sender, request, logger)
page_requested (after a page request, ha!)
page_not_found (for non-existent pages! O'really?)
path (URL)
deeppages.models.Page()
dictionary (with request inside)
content (you can change it as you wish)
normalize_path(request.path)
is_acceptable_file_type(path)
logger.debug('DeepPage Path Requested: [{}]'.format(path)
issubclass(sender.__class__, MiddlewareMixin)
Page.objects.exclude(is_active=False)
Q(path__iexact=path)
Q(path__iexact=request.path)
logger.exception('DeepPage Not Found: [{}]'.format(path)
issubclass(sender.__class__, MiddlewareMixin)
render_requested_page_content(sender, request, page)
get_page_by_name(name, context=None, callback=None)
rendering (default: None)
content (default: None)
Page.objects.exclude(is_active=False)
get(name__iexact=name)
render_page(page, context, callback)
get_page_by_slug(slug, context=None, callback=None)
rendering (default: None)
content (default: None)
Page.objects.exclude(is_active=False)
get(slug__iexact=slug)
render_page(page, context, callback)
Copyright (c)
files (the "Software")
Geometry(object)
marshal(cls, dic)
cls(**dic)
cls.marshal(dic)
__init__(self, **dic)
super(Geometry, self)
self.__class__.mro()
s.__init__()
s.__init__(**dic)
Point(Geometry, geoutil.Latlng)
marshal(cls, dic)
cls(**dic)
__init__(self, **dic)
super(Point, self)
__init__(lat=c[1], lng=c[0], **dic)
LineString(Geometry)
line (start to end)
marshal(cls, dic)
cls(**dic)
__init__(self, **dic)
super(LineString, self)
__init__(**dic)
geoutil.Latlng(lat=self.coordinates[0][1], lng=self.coordinates[0][0])
geoutil.Latlng(lat=self.coordinates[1][1], lng=self.coordinates[1][0])
distance_to(self, point)
isinstance(point, Point)
self.nearest_point_on_line(point)
distance_to(point)
RuntimeError("Need to pass a Point object (%s)
type(point)
nearest_point_on_line(self, point)
geoutil.latlng2mercator(self.start)
geoutil.latlng2mercator(self.end)
geoutil.latlng2mercator(point)
math.sqrt(math.pow(A.x - B.x, 2)
math.pow(A.y - B.y, 2)
max(0, min(distAB, vecABx * (C.x - A.x)
geoutil.mercator2latlng(geoutil.Point(x=x, y=y)
Properties(object)
marshal(cls, dic)
cls(**dic)
__getattr__(self, name)
self.__dict__.get(name)
AttributeError("%s.%s is invalid"%(self.__class__.__name__, name)
__init__(self, **dic)
setattr(self, key, dic[key])
print("Cannot use unicode string for a property name: \"{}\"".format(key.encode('utf8')
__str__(self)
json.dumps(self.__dict__, sort_keys=True, indent=2)
Object(object)
marshal_list(cls, objects)
temp.append(cls.marshal(obj)