I defined the following function:
@auth.requires_login()
def index():
response.functionname='Basic account'
record=db(db.tagline.company_id==auth.user.company_id).select().first()
if record:
response.init_flash='Update tagline'
form=crud.update(db.tagline,record,message='Tagline updated')
else:
response.init_flash='Insert tagline'
db.tagline.company_id.default=auth.user.company_id
form=crud.create(db.tagline,message='Tagline inserted')
return dict(form=form)
When there is no tagline I get the create form and when I submit the
form the Tagline inserted flash is displayed, however, the tagline
field is empty,
1) whereas I expected it to contain the inserted tagline.
When I refresh the page I get the update form and the flash says:
Update tagline. When I update the tagline and submit the change the
Tagline updated flash displays. Which is correct.
When I check the 'check to delete' box, the alert displays, after
clicking OK and clicking submit,
2) the Tagline updated flash displays and the tagline field still
contains the tagline and the check box is still checked. When I click
submit again the tagline is being deleted and the Insert tagline flash
displays,
3) whereas I would like a flash telling the user that the tagline has
been deleted.
How do I solve these three problems?
Kind regards,
Annet.