[google-appengine] Re: Subcategory Capability with GAE Datastore Models?

2010-07-19 Thread gops
you can achieve this in polymodel by adding all common properties to polymodel base class and specific property to the hierarchy. i.e. Class LivingThing(polymodel.PolyModel): Kingdom = db.StringProperty() Phylum = db.StringProperty() Subphylum = db.StringProperty() Class Mammal(Livin

[google-appengine] Re: Subcategory Capability with GAE Datastore Models?

2010-07-19 Thread Bill Edwards
Hi guys, Thanks for the suggestions! However, there is a slight detail that I forgot to mention. I need to be able to dynamically define the subcategories, and I have literally hundreds of them already defined (more to be added by users). Storing the categories as a StringListProperty seems pro

Re: [google-appengine] Re: Subcategory Capability with GAE Datastore Models?

2010-07-20 Thread Michael DeLaney
You do this by creating a Category Class, with a string property Name, an optional reference property ParentCategory, and two functions: 1. CategoryList() which recursively returns a list of categories including the category and all child categories, 2. TopCategory() which recurses upwards and ret