more exceptiosn and edge cases

This commit is contained in:
Laura Klünder 2016-12-21 01:59:08 +01:00
parent 6508d05a3e
commit 25af1c9901
5 changed files with 84 additions and 14 deletions

View file

@ -1,6 +1,7 @@
import re
from collections import OrderedDict
import numpy as np
from django.core.cache import cache
from django.db import models
from django.db.models import Q
@ -290,6 +291,10 @@ class PointLocation(Location):
def location_id(self):
return 'c:%s:%d:%d' % (self.level.name, self.x*100, self.y*100)
@cached_property
def xy(self):
return np.array((self.x, self.y))
@cached_property
def description(self):
from c3nav.routing.graph import Graph