Chapter 9. Creating Full-Fledged Webapps: Implementing Instances

The framework for the rapid development of Python web applications is coming along nicely, but some distinct features are still lacking.

In this chapter, we take a look at some of them, notably:

  • How to implement more complex relations
  • How to create the necessary user interface components to maintain those relations
  • And how to allow for a more fine-grained control of who is allowed to do what

These are some interesting challenges, so let's get started.

Even more relations

As we have seen, it was not very difficult to make Display capable of handling references to related entities. These relations, however, are limited to lookup relations (also known as many-to-one relations). A Contact entity, for example, refers to, at most, a single Account entity and the Display class allows us to select an Account when we edit a Contact.

But what do we need for the opposite situation? An Account may have many Contacts and both Account and Contact may have many Addresses. What we need is a way to make Display show which one-to-many relationships exist for an entity and provide the means to show those entities when the user clicks on such a relation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.69.163