0

I've been hitting the soft memory limit and after much querying around here I found another person with the same issue and Nick Johnson identified that his models were too large. How can I best refactor (i.e. break up) my models?

My current model has 37 properties with many lists.

class CurrentModel(db.Model): #currently has 37 properties
    mystring = db.StringProperty()
    mylist = db.ListProperty()
    ...

I was thinking maybe I could break it up as such - but would this save memory?

class ProposedModel(db.Model): #core properties
    mystring = db.StringProperty()
    ...
class ExtendedModel(db.Model): #extended properties
    parent_model = db.ReferenceProperty(ProposedModel)
    mylist = db.ListProperty()
    mylist1 = db.ListProperty()
    ...
4

0 に答える 0