In my database, I have a lot of duplicated data between entries. For
example, I might have a database of foods where Meats is the parent
object and Cheeseburger is one of its children.
o.name = "Meats"
o.text = "This food is really unhealthy....lots of text"
o.category = "Meats"
p.parent = o.id
p.name = "Cheeseburger"
If unpopulated, I'd like the parent's data to be accessed. I
implemented this inside the model on an attribute-by-attribute basis,
but this seems to stink of bad design, since every time I add a new
field, I have to write duplicate code that checks if the attribute is
Any ideas would be greatly appreciated.