Reputation
Top tag
Next privilege 125 Rep.
Vote down
Badges
5
Newest
 Teacher
Impact
~626 people reached

  • 0 posts edited
  • 0 helpful flags
  • 10 votes cast
Jun
29
comment What is the proper name for this design pattern in Python?
Thank you for that pointer. One of the reasons I liked the single-class approach is it allowed me to subclass models and do stuff like: def get(id): #code-goes-here return self(results) and I didn't want to give up the simplicity of return self(results). But, in other places, such as the query module, I pass in the "model" classes so the results could be initialized to the proper class. Evidently this is what Django is doing too. I finally bit the bullet and switched back to the two class approach where a proxy does the get instead of a subclass and am passing the model class to proxy.