'Representation of a new/updated location row (before DB commit).
NB: Using a fake path here in order to prevent
gis_LocationRepresent.represent_row() from running
update_location_tree as that would change DB status which
is an invalid action at this point (row not committed yet).
This method is called during S3CRUD.validate for inline components
@param values: the values dict
@return: string representation for the values dict'

def represent(self, value):

    if ((not value) or (not any((value.get(key) for key in self.keys)))):
        return current.messages['NONE']
    lat = value.get('lat')
    lon = value.get('lon')
    wkt = value.get('wkt')
    radius = value.get('radius')
    address = value.get('address')
    postcode = value.get('postcode')
    record = Storage(name=value.get('name'), lat=lat, lon=lon, addr_street=address, addr_postcode=postcode, parent=value.get('parent'))
    specific = value.get('specific')
    if specific:
        record_id = specific
    elif (address or postcode or lat or lon or wkt):
        specific = True
        record_id = value.get('id')
    else:
        record_id = None
    if (not record_id):
        record_id = 0
    record.id = record_id
    lx_ids = {}
    path = [str(record_id)]
    level = None
    append = None
    for l in xrange(5, (-1), (-1)):
        lx = value.get(('L%s' % l))
        if lx:
            if ((not level) and (not specific) and (l < 5)):
                level = l
            elif (level and (not record.parent)):
                record.parent = lx
            lx_ids[l] = lx
            if (append is None):
                append = path.append
        if append:
            append(str(lx))
    path.reverse()
    record.path = '/'.join(path)
    if (specific or (level is None)):
        record.level = None
    else:
        record.level = ('L%s' % level)
    s3db = current.s3db
    ltable = s3db.gis_location
    if lx_ids:
        query = ltable.id.belongs(lx_ids.values())
        limitby = (0, len(lx_ids))
        lx_names = current.db(query).select(ltable.id, ltable.name, limitby=limitby).as_dict()
        for l in xrange(0, 6):
            if (l in lx_ids):
                lx_name = lx_names.get(lx_ids[l])['name']
            else:
                lx_name = None
            if (not lx_name):
                lx_name = ''
            record[('L%s' % l)] = lx_name
            if (level == l):
                record['name'] = lx_name
    represent = self._represent
    if (represent is None):
        represent = s3db.gis_location_id().represent
    if hasattr(represent, 'alt_represent_row'):
        text = represent.alt_represent_row(record)
    else:
        text = represent(record)
    return s3_str(text)
