Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is documented <a href="http://code.google.com/appengine/docs/python/datastore/expandoclass.html" rel="nofollow">here</a>. The snippet provided is valid, although it's not clear why the class is completely empty (might be for illustrational purposes). I suppose the main question is <em>when to use Expando Model</em>? </p> <p>Imagine a site collecting orders for all kinds of goods possible. One customer might want to order a kitten, another one might want to order a book, etc. A books and a kitten have very little in common, maybe just a price and weight. But we want our customers to provide details on their irders, e.g. one customer might order a kitten 3 months old, siamese, blue eyed, and another might order "Lord of The Rings" 2nd edition, hardcover, author signed, etc. Although these properties aren't relevant at the moment of collecting an order, they are vital of your business logic. Also you might process these properties later. </p> <p>The only solution here is to use Expando model, because you can't create a universal class (or hierarchy of classes) covering all the existing properties. The Expando model will hold all the general properties (price, weight, tracking id, shipping cost, custom fees, etc.) and methods (calculating total, discounts, etc.), the rest of the properties will be created by the customer dynamically at runtime. A model instance will be saved into the datastore with all its properties, and any particular instance will return all the properties defined on it via Model.properties() method. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload