O'Reilly logo

Programming Python, Second Edition by Mark Lutz

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

Submitting PyErrata Reports

The next major functional area in PyErrata serves to implement user-controlled submission of new comment and errata reports. As before, let’s begin by getting a handle on this component’s user-interface model before inspecting its code.

User Interface: Submitting Comment Reports

As we’ve seen, PyErrata supports two user functions: browsing the reports database and adding new reports to it. If you click the “General comment” link in the Submit section of the root page shown in Figure 14-2, you’ll be presented with the comment submission page shown in Figure 14-16.

Submit comments, input page

Figure 14-16. Submit comments, input page

This page initially comes up empty; the data we type into its form fields is submitted to a server-side script when we press the submit button at the bottom. If the system was able to store the data as a new database record, a confirmation like the one in Figure 14-17 is reflected back to the client.

Submit comments, confirmation page

Figure 14-17. Submit comments, confirmation page

All fields in submit forms are optional except one; if we leave the “Description” field empty and send the form, we get the error page shown in Figure 14-18 (generated during an errata submission). Comments and error reports without descriptions aren’t incredibly useful, so we kick such requests out. All other ...

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