db.define_table('articles',
Field('article_date', 'date'),
Field('article_title'),
Field('article_link', compute=lambda r: r.article_title.replace(' ',
'-')),
Field('image', 'upload'),
Field('body', 'text'))
def index():
return dict()
def articles()
article = db(db.articles.article_link==request.args[0]).select()[0]
return dict(article=article)
I want to use manage and grid functions to edited the articles table
so records should to editable after insertion.
@auth.requires_membership('admin')
def manage():
grid=SQLFORM.grid(db.articles,
editargs=dict(fields=['article_date','article_title','article_link','image','body']))
return grid
@auth.requires_membership('admin')
def grid():
response.view = 'generic.html'
tablename = request.args(0)
if not tablename in db.tables: raise HTTP(403)
grid = SQLFORM.smartgrid(db[tablename], args=[tablename],
deletable=False, editable=True)
return dict(grid=grid)
With the compute function on the table the SQLFORM.grid or smartgrid
records can not be updated.
On Friday, April 20, 2018 at 12:27:07 AM UTC, Anthony wrote:
>
> On Thursday, April 19, 2018 at 3:43:02 PM UTC-4, dirman wrote:
>>
>> The page reloads the same SQLFORM edit form page with edited field not
>> submited
>>
>
> Works for me. Please show all your code and describe the exact workflow.
>
> 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.