O'Reilly logo

Python 3 Web Development Beginner's Guide by Michel Anders

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action enhancing Browse

All this passing around of the related parameter originates with the user clicking an 'add' button in a list of entities that, in its turn, was shown in response to clicking a related tag when editing or viewing an item.

Those lists of entities are generated by the index() method of the Browse class, so we have to make sure that suitable information (that is, the name of the entity that is listed together with the ID of the instance) is passed on.

This means we have to:

  • Enhance the index() method to receive a related parameter that can be passed on when the 'add' button is clicked.
  • Extend the code that generated the form associated with this add button with a hidden<input> element to hold this information, so that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required