Chapter 8. Managing Customer Relations

There is more to an entity framework and CherryPy application code than just merely browsing lists. The user must be able to add new instances and edit existing ones.

In this chapter, we will:

  • See how to display instances
  • How to add and edit instances
  • How to provide auto complete functionality to attributes referring to other entities
  • How to implement picklists

So let's get on with it...

A critical review

Now that we have created an object relational framework in the form of an entity and relation modules, it is time for a critical reappraisal.

A couple of larger and smaller issues may hinder us in quickly prototyping and implementing a database-driven application:

  • We already keep an administration of the additional properties of the entity attributes, for example, whether an attribute has a validator function. It might be a good idea to store things like the preferred representation of an attribute's value as well. We also want to have the possibility of keeping a record of allowed values, so we can implement picklists
  • Although the framework is flexible enough for a developer to quickly implement a database-driven application, it does not have any functionality to let an end user alter the database schema. It is not possible to add an attribute to an entity, for example. Even if this were possible, we would still need some authorization scheme to limit this functionality to authorized users only.

In the following chapters, we will tackle these limitations one-by-one and each step will bring us closer to implementing our final example: a customer relations management application. Some parts of this process require us to perform some pretty sophisticated Python tricks, but these parts are clearly flagged and may be skipped.

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

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