Working after adding compute=lambda

Field('link', compute=lambda r: r.article_link.replace(' ', '-'))

However the table fields can not be updated using grid


On Wednesday, April 18, 2018 at 6:12:40 PM UTC, Anthony wrote:
>
> On Wednesday, April 18, 2018 at 10:57:11 AM UTC-4, dirman wrote:
>>
>> http://......./articles/high-temperature-in-city
>>
>> def articles():
>>      news = db(db.articles.article_link==request.args[0]).select()[0]
>>      return(news=news)
>>
>
> I see. Yes, if you need to use the values to make a database query, then 
> it is probably best to store them in a database field, so use a computed 
> field.
>
> Please show the code that is generating an error along with the full 
> traceback.
>
> Anthony
>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to