Hello I have a field in my table defined like so

Field('region', 'list:reference region'),

The data entered is multiple regions in the form, Gibsons, Sechelt

I am wondering since it is not an id how I can pass the name of the town as
an argument, so it only selects entries from that town

this is the view from the search_methods/region page

   <ul data-role="listview" data-inset="true">
        {{for region in region_query:}}
            <li><a href="{{=URL('views', 'region', args=(region.id))}}"
target="_blank" data-transition="fade" title="{{=region.title}}"
>{{=region.title}}</a></li>
        {{pass}}
    </ul>

I need to change the *a* tag I think here so I can pass the correct argument

here is the controller function for the views/region page (where the above
a tag points to) not sure what to change here any ideas are greatly
appreciated

def region():
    region = request.args(0)
    query = db.listing.region == region
    orderby = db.listing.title
    pcache = (cache.ram, 15)
    paginate = Pagination(db, query, orderby, display_count=10,
cache=pcache, r=request, res=response)
    region_query = paginate.get_set(set_links=True)
    region_text = db(db.region.id == region).select()

    return dict(region_query = region_query, region_text=region_text)

*cheers

and ty

Andrew

-- 



Reply via email to