Killer Web Development

by Marco Laspe

8.5 Exercises

  1. Write 2 more tests for the entry form:

    1. One that tests for messages longer than 300 chars not being submitted.
    2. One that tests for message with zero chars not being submitted
  2. Change the code, that the tests from exercise 1 pass. Hint: It it fairly simple with web2py's DAL. Maybe you should have a look at web2py's docs.

  3. Add some more information to the profile page - like in the image below. Style this info accordingly. Hint: You don't need to change the database model.

  4. Make the date shown on the messages prettier.

  5. Think about the 'message' model. Could we add some fields that make sense?

  6. Killer-Exercise: Put a delete link in each individual message. After the link is clicked, the message should be deleted and the user should be redirected to his profile page. Hint: You should write a new function, use proper error handling and us the crud.delete() method.


Books often read by web2py and Python experts:

Comments

Leave a Reply

Required fields are marked *.