Not sure I read your question carefully enough,  but maybe you need 
something like:

query = db.listing.region.contains(region)

Anyhow,  contains has a special usage for list fields. 


On Thursday, September 20, 2012 5:07:46 PM UTC+1, Andrew Evans wrote:
>
> I have since added format='%(title)s %(id)s' to the region table but the 
> listing is not being selected
>
> Is it because it is a list?
>
> I have entered multiple region entries for a single listing any idea how 
> to select that listing in each of those regions when using the region 
> search method?
>
> *cheers
>
> and ty
>
>
>
> On Thu, Sep 20, 2012 at 7:53 AM, Andrew Evans <[email protected]<javascript:>
> > wrote:
>
>> 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